TryingMyBest
Registered User.
- Local time
- Today, 21:30
- Joined
- Nov 18, 2004
- Messages
- 54
Hi,
I have a main form that is unbound. On that main form is a subform which is bound to a query and displays the results in datasheet format. There is nothing else to the subform.
My users want to be able to click on a record in the subform and have the corresponding data displayed in the main form. To do this all I need to do is update one text field with a number that corresponds to the record that is selected...this is an autonumber but not always the record number. The code will take care of the rest.
As an example: if the programme is let's say A, the subform will display all related audits...these may be audit numbers 1,4,7,10 but the record number would be 1,2,3,4. I need to capture that audit number and display it in the audit number field on the main form.
I have managed to display the previous selected record but can't figure out how to update each time a new record is selected.
Here's the code I have so far:
Many thanks for all your help.
BTW: I've no idea why there is a space in the word 'details' in my code....it's not like that in the application.
Jo
I have a main form that is unbound. On that main form is a subform which is bound to a query and displays the results in datasheet format. There is nothing else to the subform.
My users want to be able to click on a record in the subform and have the corresponding data displayed in the main form. To do this all I need to do is update one text field with a number that corresponds to the record that is selected...this is an autonumber but not always the record number. The code will take care of the rest.
As an example: if the programme is let's say A, the subform will display all related audits...these may be audit numbers 1,4,7,10 but the record number would be 1,2,3,4. I need to capture that audit number and display it in the audit number field on the main form.
I have managed to display the previous selected record but can't figure out how to update each time a new record is selected.
Here's the code I have so far:
Code:
Me.txtAuditNumber.Value = Forms!frmAuditProgrammePlanning!SUBProgrammeDetails!AuditNumber
Many thanks for all your help.
BTW: I've no idea why there is a space in the word 'details' in my code....it's not like that in the application.
Jo