Open Form And Pass Data
Apr 19, 2006
Hi All,
I should know how to do this but my brain has gone blank.
I have a form "frmMainClient" which has a field "account_no".
On the main form "frmMainClient" I have a command button which opens a pop up form ""frmJobNew" where I can enter a new job record. The "frmJobNew" form has a field "account_no".
I am trying to auto fill the "account_no" field with the data from the "frmMainClient" - "account_no" field and store the passed data when the record is saved.
I can pass the data using "=forms![frmMainClient]![account_no] in the "account_no" field on the "frmJobNew" but when I save the record the data is not saved.
Can anyone offer help, please
Many thanks.
View Replies
ADVERTISEMENT
Jun 21, 2013
I have modal form - frmZlecenia
I would like to copy one control, then close this form, open concrete form and pass value to control.
My code is
Private Sub Menu_Click()
DoCmd.OpenForm "frmZleceniaMarzenaNawigacjaPD"
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie = Me.Imie
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie.SetFocus
DoCmd.Close acForm, Me.name
End Sub
The problem is, still opens the previous form, not form "frmZlecenia"
e.g If I open form x then from this form I open my modal form "frmZlecenia" and then I will click "menu" button - now form "x" is open :/, but should be "frmZleceniaMarzenaNawigacjaPD"
There is some way to open concrete form from modal form?
View 1 Replies
View Related
Feb 19, 2014
I have a button on my main db, that opens a second db using hte following code:
----------------------
'Dealing with external objects, use inline error trapping
On Error Resume Next
Dim appAccess As Object
Dim db As Database
Dim strAppPathName As String
Dim strAppName As String
Dim strTimesheetPathName As String
[Code] ....
This code works great to open the other db, and handles wheter the other db is already open or not, but I cant seem to pass the variable to the other db using the startup switch /cmd.
I suspect if I used the shell method it would pass the cmd , but I havnt found any way to test if the db is already open with the shell method.
How can I pass a variable to the other db when opening it using VBA?
View 10 Replies
View Related
Sep 26, 2013
I'm working on a database that will be used when maintenance needs to be performed on our test equipment. So far, I have a form set up for the associates to track when a maintenance action has been performed. The top section of the form contains basic data about the part and there is a subform that lists the actions that need to be taken on the piece of equipment. In the subform, the associate can mark whether the action is complete or not.
If the action is marked incomplete, I wanted a separate form to appear for them to track why an action cannot be performed. If possible, I would like this separate form to automatically show the equipment ID and the action that was missed. However, I'm having difficulty getting the data to copy from the subform to the Exception form. Is this something that is possible to do?
View 2 Replies
View Related
Aug 25, 2006
I have a form where a user can press a button, which then prints a report.
The report is basically the same as the form but laid out neater and in a format that fits it to 1 A4 page.
For one of these reports, I would like it to run a different query depending upon which form is used. I know with the forms you can use an open args property but is there a similar way to pass this to a report and have it print immediately?
If so, what's the best method?
Thanks
View 1 Replies
View Related
Jul 6, 2006
Hi everyone! :)
First off I have to say I'm not an Access Guru by any means. I can make a very very basic database in access but beyond that I'm toast.
So I've just started working on a project that is in it's second year. The project was started last year by a student and she created, what seems to me, to be an adequate small database for the project. I've noticed however that when entering data, some of it has to be entered twice. This has been made easier through the use of the look up tab in the field definition (?). However, I worked with a student before who created a database where the primary key value of a "parent?" table was automatically forwarded to the corresponding field in the "child?" table.
So here's a hypothetical, let's say you have a restaurant, and one restaurant can have ummmm many tables, and then one table can have manyyyy chairs! There's a unique restaurant id created in the restaurant table, which is say needed with a table number to create a unique table id in the table table, which is in turn needed with a chair number to create a unique chair id in the chair table? So you basically have 3 tables where unique ids are being created. So then lets say you have a chair description table that has fields in it to contain all the ids made previously, as well as some of the information entered to create the unique fields (i.e. table number, chair number). My question is..if I've already entered this data in previous parent tables then why is it that the data doesn't carry forward to these fields? Is it because these fields are not primary key fields in this last table? If that's the case then is there a way to set this up? Right now there's a select statement used in the look up reference option that has something to the effect "select table.table_name from table;". So I know what it's doing and when I enter data I can select the table id I need. It just seems a bit redundant data entry wise to enter yet again values I entered the table before, or values that were generated for me in the table before.
Is there a way to have these fields automatically populate with the corresponding data that was entered to get to this table? Does it involve modifying the select statement to involve a where clause (terminology? clause?). Any ideas would be very much appreciated! Thanks.
Sue
View 5 Replies
View Related
Apr 2, 2014
I have a main form[frmResearchNotes] with combo box controls that filters a query populating [subfrmNotelist] containing several records from the filtered query. From there, I double click on a field within one of the remaining records, [CompanyName] for example, and it opens the new form[frmNoteDetail]. The problem is that second form is not displaying that selected record. The second form's record source has been set to the same query so when it loads, it displays the same info but it's displaying the 1st record out of the entire filtered list, not the record I clicked on in that list.
I figured I could use the strWhere function to copy the record I selected in the event procedure and then open the new form with those details. Not sure how to actually do this with VBA or if it's even the correct approach.
View 14 Replies
View Related
Feb 9, 2005
I want to open a form so it is blank.
I have looked through old posts, and the only way I can see to do it is using:
DoCmd.GoToRecord , , acNewRec
However, this is no good for me, as I dont want to allow data entry AND I have default values for one of the fields.
Is there a way to do this?
Thanks.
View 10 Replies
View Related
Jul 15, 2005
Good afternoon, I have a form with a subform and in the first txtbox of the subform in the GotFocus event I have a little procedure which checks the txtboxs on the parent to make sure that there is data in all four of the txtboxes. This works great the first time and it pops up a msgbox and it even setsfocus on the txtbox with no data in it, but if I tab into the subform a second time and there still is no data in one of the txtboxs on the parent form, nothing happens, no message and no setting focus on the txtbox with no data in it. Does anyone know of a way to get this procedure to re-set everytime a user tries to enter the subform? Thank you in advance to anyone offering and ideas and suggestions.
View 8 Replies
View Related
Jul 4, 2006
I have tried searching, but have not foud anything that quite fits the bill for this.
I would like to add some code to my event procedure for opening my form so that when it opens a field has a value entered in it and then the record is saved.
My form name is frmCompanyClients based on tblCompanyClients and the field is ClientType (text box)
I don't want to use a default value as I want to change what goes into that field depending on user input on the Front Form.
I need to save the record as soon as that is done so that a Client_ID number is generated and my subforms can then be properly associated via the Client_ID field. I was having problems with unassociated records, and found out that it was because I was entering data into the subforms first and not any of the parent form's fields and so because no Client_ID was generated I was getting the lost records.
Thanks
Nicolas
View 4 Replies
View Related
Jul 20, 2007
Hello,
Is it possible to pass a AutoNumber Format variable and data to a new table using an Append Query? If not does anyone know what I can try?
Thanks!
View 1 Replies
View Related
Feb 22, 2015
i have a form with automatic ID, i open new form and want this ID to be in a the new form's field , and when i add data in new form , that this data will be written in the table.when i use this command:=([Forms]![Field]![Table]) it shows the ID number in the new form, but when i click add data it add all input but the ID number.
View 1 Replies
View Related
Jan 10, 2014
I get a result set from a pt qry from a sql server 2008 in vba. Me.Total is an unbound field in the report foot( correct translation of german "Berichtsfu"??)
Private Sub Berichtsfu�_Print(Cancel As Integer, PrintCount As Integer)
SELECT SUM((DATEPART(hour, Calctime) * 60 + DATEPART(minute, Calctime)) * Price / 60) AS TtlPrice ...
Set rs = CurrentDb.OpenRecordset("qryPT_TtlPrice")
Me.Total = rs("TtlPrice ")
On the access report I can format me.Total as currency, decimal, integer whatever I want (unless it makes no sense exept currency) and it works.
but
SUM(((DATEPART(hour, Calctime) * 60 + DATEPART(minute, Calctime)) * Price/ 60)* (case when CompanyID=1 then 1.66 else 1 end)) AS TtlPrice
The detail should be multiplied with 1,66 when the record belongs to company 1, for all others ist remains the same. In the Management Studio the results of both looks similar, same in the debug window of VBA editor, but I cannot format the result or lets say, the formating is wrong for the second example.
Neither in VBA
Me.Total = format(rs("TtlPrice "), " 0.000,00") or
Me.Total = format(rs("TtlPrice "),"0.000,00")
nor in the report int the properties of the field I can avoid this result: in the debug window of access the result looks OK, for example 29555.670000 (don't know where all the 0 come from), which should read as 29.555,67. But on the report the result with formated curreny in field property (currency, 2 decimals) shows 29.555.670.000,00
View 5 Replies
View Related
Feb 16, 2015
I have code that will create an email and prepare it for sending.It will create a table inside the email and fill it in with some text and underscore characters to be replaced by data from the database. So far the data has to be done manually. I would like to know if it is possible to use the values from some fields inside the select record in the current form. So, if Me.Status would be "New" it should pass this to the table in the email.So far I have the below code:
Code:
Private Sub Command280_Click() 'send email with table
Dim objItem As Object
Dim oMail As Outlook.MailItem
Set oMail = objItem
Dim oApp As Object
[code]...
View 5 Replies
View Related
May 12, 2006
Hi all,
Not sure if this is in the right section but heres my question.
How can i gett a button to open a word document and put in specific information. for example. to send a client a letter, the button would open a word doc with the specfic client data in it.
Also a button to start a mail merge with all client records held on the db.
Thanks for any help
View 2 Replies
View Related
Jun 22, 2014
So, I've got a frmCustomer and want to link the form to frmNewWorkOrder using a button.
More precisely when I choose/scroll to a customer and click the button "New work order" to autofill data from selected client from frmCustomerto frmNewWorkOrder (First and Last name, telephone number and client ID).
View 2 Replies
View Related
May 15, 2013
I have a form called frmStartTimeEntry where a user inputs data using a barcode scanner. In this form there is a field called Part_No where after a value is inserted, I'd like the form to check if table_lines_per_part includes this part. If not found, then I'd like the form to open another form called frmLinesPerPart where the form would pull the same Part_No inserted in the previous form to fill in the Part_No field (which is hidden) and then the user would type in a qty for the LinesPerOrder. A user would then click a button btnOk to append this new record to table_lines_per_part and be returned to the frmStartTimeEntry to continue filling out the rest of the form.
This is the idea I have but I don't know how to code the part where the form checks after update if the part_no exists in the other table, nor how to capture the part_no to the other form and then append both the part_no and the lines per part to the other table.
View 2 Replies
View Related
Jun 8, 2014
I create a table that have one hyperlink data type and i want to open a existing form that i created using this hyperlink.
Can this hyperlink data type open a form in the same access database? or open form in different access database?
Using hyperlink button have the function to open form in same database but the problem is this function is not available in hyperlink data type.
View 2 Replies
View Related
Apr 16, 2014
Is there any possibilities to open form after INSERT INTO? I think Ms Access can't fast refresh data in the table after that, so form opens up clean:/
Code:
...
strSQL = "INSERT INTO tblZlecenia (id_zlecenia_info, DataPrzyjecia) VALUES ('" & ostateczne & "', Date())"
CurrentDb.Execute strSQL, dbFailOnError
DoCmd.OpenForm "Formularz2", WhereCondition:="ID_Zlecenia=" & ostateczne
View 5 Replies
View Related
Apr 1, 2013
I have a form and this form shows some values from one table. One of the fields named as Key. I want to open another form and show the record that has the same value as Key.
I am able to make this with filter but the form opens and when the user navigates the record, it creates a duplicate value in related table.
I want to open form and find specific data to display and then stop at this record.
View 1 Replies
View Related
May 2, 2013
I am currently creating a database in a hierarchical system that is to be used by multiple users to enter information specific to them. The tables are arranged like this:
Owners
Modules
Tasks
Highlights
Theses are connected using primary ID's and Particular Entries in the next table so they form a hierarchy - when you expand owners it brings up a list of Modules attached to that owner, then expand each module and it brings up a list of tasks associated with that module, expand the task and it brings up a list of highlights associated with that task. This is all very straightforward of course but what I would like to do is create forms that basically match so that the users can navigate from their name, through their modules and tasks and then add highlights to each task.
For this I have been using continuous forms to list all the different entries and inserting a button in each entry that I would like to link to the next form and find the specific data, however when I try to do this the button always without fail will just return all the entries from the form rather than the specific ones requested. I set up the button using the wizard and select 'open form and find specific data' and then select two entries that are identical on each form. I have trawled the internet quite a bit to try and find why this is happening and have inserted various bits of code etc into the embedded macro in an attempt to make it work but to no avail.
I wonder if there is something I need to activate on the form that the button connects to aswel or if I need to connect these forms using the relationship that I used to connect the tables (I am still using a unique identifier).If I connect to a single form it will display the first entry on the list (and I can cycle through them all) on a continuous form it will display all entries starting with the first.I would like it to display all entries for the selected record on the form.
View 1 Replies
View Related
Jan 31, 2014
Test findings showed that when I open a form the data does not update. I added a refresh action after the openform action. If I want to open three forms via the macro, do I need three refresh actions, one after each openform action, or simply a single refresh action that would apply to all three forms.
Scenario 1:OpenForm1, Refresh, OpenForm2 Refresh, OpenForm3, Refresh
Scenario 2:OpenForm1, OpenForm2, OpenForm3, Refresh
View 5 Replies
View Related
Aug 25, 2011
I have a subform in which I want to put in a Command Button to open another form.
I used the wizard as per normal, but when you come to matching specific data fields, there is nothing in my left hand column of the sub form. I have checked the record source property and it is bound to the correct table.
I have read that this is an issue with Access 2007? Is this the case or am I missing something obvious here?
View 3 Replies
View Related
Nov 26, 2013
So I have 2 forms, an Edit Lot Form, and an Add Run Form. Each lot will contain several runs. What I want to do is be able to add a run associated with the specific lot by pressing a button "Add Run" in the lower right corner of the edit lot form (see attached images). So the information for the lot will carry over to the run form and autofill the fields pertaining to the Lot in that form.
View 2 Replies
View Related
Jul 24, 2013
I have a report that tracks scores for our employees. From the report, you can click a button to add a new score in a form or edit an existing score(frmscoretracker). On this form there are two subforms, in a tabbed control to track additional information about the score; what areas were marked down(Trends), and was it a failing score(AutoFail).
When this form opens I have it programmed to only show the subform if there is data in it. The goal being, if I am adding a new score and there is no existing trends or Autofails for this new record, neither subforms will show - I will add an after update even to show either trends or autofail depending on the score recorded. Also, if someone chooses to edit the score, whatever subform with data, will show as well.
When someone clicks to add a new score, opening this main form to a new record, both of the tabs show. However, if the form opens to an existing record, the appropriate tab shows. Here is the code
Code:
Private Sub Form_Open(Cancel As Integer)
'If the subform has a record, the tab is visible, if not, the tab is not visible
If Me.frmtrends.Form.Recordset.RecordCount > 0 Or IsNull(Me.Trends) Then
Me.Trends.Visible = True
Me.TabCtl33.Visible = True
Else
Me.Trends.Visible = False
End If
[code]...
Both tabs are set as not visible in the default settings. Is there something in this code that is triggering then to be visible when there is no record in the main form?
View 4 Replies
View Related
Jul 10, 2013
I am trying to open a word document with corresponding data filled from the text field of a form. I managed to get the word document but I don't know how to give a variable in word document.
View 2 Replies
View Related