If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Autopopulating Field
Hi, I made a subform that has a button in it that when clicked will open a
different form in a new window. The subform contains a different record for each service for the specific person listed in the main form. The button opens a form where I can enter specific billing info every month for the specific service number that is currently displayed. I have a table for "services" and a table for "monthly billing" and each contain a field called "service number". I have these 2 tables linked together by this field in the relationships windows. What I want to do is when I click on that button is bring up the form to enter the specific billing details for the service number that is currently displayed. When I do this though, the service number field in the "monthly billing" table is not entered in automatically. I am a beginning Access user and would like to know how to do this. Thank You, CEV |
#2
|
|||
|
|||
CEV wrote:
Hi, I made a subform that has a button in it that when clicked will open a different form in a new window. The subform contains a different record for each service for the specific person listed in the main form. The button opens a form where I can enter specific billing info every month for the specific service number that is currently displayed. I have a table for "services" and a table for "monthly billing" and each contain a field called "service number". I have these 2 tables linked together by this field in the relationships windows. What I want to do is when I click on that button is bring up the form to enter the specific billing details for the service number that is currently displayed. When I do this though, the service number field in the "monthly billing" table is not entered in automatically. I am a beginning Access user and would like to know how to do this. Thank You, CEV A quick guess is you will need to pick an event (like form open) and use that to trigger and event to cause FORM2SERVICENUMBER=FORM1SERVICENUMBER. Change the names to fit your application. -- Joseph Meehan Dia duit |
#3
|
|||
|
|||
Thanks for the response. But now where do i do this at? And do I enter it
exactly like that but with the actual name of my forms? Thanks, CEV "Joseph Meehan" wrote in message . .. CEV wrote: Hi, I made a subform that has a button in it that when clicked will open a different form in a new window. The subform contains a different record for each service for the specific person listed in the main form. The button opens a form where I can enter specific billing info every month for the specific service number that is currently displayed. I have a table for "services" and a table for "monthly billing" and each contain a field called "service number". I have these 2 tables linked together by this field in the relationships windows. What I want to do is when I click on that button is bring up the form to enter the specific billing details for the service number that is currently displayed. When I do this though, the service number field in the "monthly billing" table is not entered in automatically. I am a beginning Access user and would like to know how to do this. Thank You, CEV A quick guess is you will need to pick an event (like form open) and use that to trigger and event to cause FORM2SERVICENUMBER=FORM1SERVICENUMBER. Change the names to fit your application. -- Joseph Meehan Dia duit |
#4
|
|||
|
|||
CEV wrote:
Thanks for the response. But now where do i do this at? And do I enter it exactly like that but with the actual name of my forms? First you need to find an "event" that takes place anytime you want to do the copy. You also want to pick an event that will not take place when you don't want to copy the data. Look at the properties of the event and you should be able to figure out where to put it. Notes: Copying data is often not a good idea. If you have data one place, more often than not, you should just refer to it when ever you need it rather than copying and saving it somewhere else. Not only is it more efficient for Access, it also means the data will always be up to date, If you copy and for some reason it gets changed, the copy does not get changed. You will want to make sure that you identify the specific source and destination. Doing that depends on what they are. I am not sure what the relationship (database relationship) is between the two fields so that could enter in when writing the code. It tends to be application specific. Thanks, CEV "Joseph Meehan" wrote in message . .. CEV wrote: Hi, I made a subform that has a button in it that when clicked will open a different form in a new window. The subform contains a different record for each service for the specific person listed in the main form. The button opens a form where I can enter specific billing info every month for the specific service number that is currently displayed. I have a table for "services" and a table for "monthly billing" and each contain a field called "service number". I have these 2 tables linked together by this field in the relationships windows. What I want to do is when I click on that button is bring up the form to enter the specific billing details for the service number that is currently displayed. When I do this though, the service number field in the "monthly billing" table is not entered in automatically. I am a beginning Access user and would like to know how to do this. Thank You, CEV A quick guess is you will need to pick an event (like form open) and use that to trigger and event to cause FORM2SERVICENUMBER=FORM1SERVICENUMBER. Change the names to fit your application. -- Joseph Meehan Dia duit -- Joseph Meehan Dia duit |
#5
|
|||
|
|||
On Wed, 12 Oct 2005 12:07:09 -0500, CEV wrote:
Hi, I made a subform that has a button in it that when clicked will open a different form in a new window. The subform contains a different record for each service for the specific person listed in the main form. The button opens a form where I can enter specific billing info every month for the specific service number that is currently displayed. I have a table for "services" and a table for "monthly billing" and each contain a field called "service number". I have these 2 tables linked together by this field in the relationships windows. What I want to do is when I click on that button is bring up the form to enter the specific billing details for the service number that is currently displayed. When I do this though, the service number field in the "monthly billing" table is not entered in automatically. I am a beginning Access user and would like to know how to do this. Thank You, CEV An additional approach to Joseph's solution (which one is more appropriate depends on the situation) is to pass the Service Number in the OpenArgs argument of the OpenForm method, and use the Form's Open event to set the DefaultValue property of a control: Dim strFormname As String Dim strCriteria As String strFormName = "YourSpecificForm" strCriteria = "[Service Number] = " & Me![Service Number] DoCmd.OpenForm strCriteria, WhereCondition := strCriteria, _ OpenArgs = Me![Service Number] more code and in YourSpecificForm's Open event Private Sub Form_Open(Cancel as Integer) If Me.OpenArgs & "" "" Then ' was an Openargs passed? Me!txtServiceNumber.DefaultValue = Chr(34) & Me.OpenArgs & Chr(34) End If End Sub Thus if the calling form's ServiceNumber is 123, the DefaultValue property of the textbox txtServiceNumber will be set to "123" and new records created on the form will pick up 123 as their value. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Form, Subform, Tab key | 2nd_Stage_User | Using Forms | 17 | August 25th, 2006 12:30 AM |
Follow up Question – Convert one field into three fields | Doug | General Discussion | 2 | April 9th, 2005 10:21 PM |
Syntax needed to get needed reports | Frank Lueder | New Users | 15 | January 6th, 2005 08:39 AM |
New Record Update | Michelle | Using Forms | 5 | October 28th, 2004 07:59 AM |
field manipulation | Steve | Running & Setting Up Queries | 2 | May 28th, 2004 03:12 PM |