Hi!
I have a form, frmInputMain, that shows all of the data for a record and you can step through each record one by one. You can edit a record, or add a new one.
Then I have a search where the results are returned in the continuous form, frmSearchResults. On that form I have a button, cmdEdit, where when clicked, it links ContractNumber (primary key) of the select record to frmInputMain, for editing.
The linking is done with this code in the on click of cmdEdit (txtContract is the textbox for ContractNumber),
Dim CNum As String 'yes, it is a string
CNum = Me.txtContract
DoCmd.OpenForm "frmInputMain"
[Forms]![frmInputMain].txtContract = CNum
When clicked, frmInputMain's txtContract displays the linked ContractNumber, but does not show the rest of the data attached to that record. How do can I tell frmInputMain that I want to edit the record whose ContractNumber was passed, not just making txtContract equal ContractNumber?
I thank you in advance.
I have a form, frmInputMain, that shows all of the data for a record and you can step through each record one by one. You can edit a record, or add a new one.
Then I have a search where the results are returned in the continuous form, frmSearchResults. On that form I have a button, cmdEdit, where when clicked, it links ContractNumber (primary key) of the select record to frmInputMain, for editing.
The linking is done with this code in the on click of cmdEdit (txtContract is the textbox for ContractNumber),
Dim CNum As String 'yes, it is a string
CNum = Me.txtContract
DoCmd.OpenForm "frmInputMain"
[Forms]![frmInputMain].txtContract = CNum
When clicked, frmInputMain's txtContract displays the linked ContractNumber, but does not show the rest of the data attached to that record. How do can I tell frmInputMain that I want to edit the record whose ContractNumber was passed, not just making txtContract equal ContractNumber?
I thank you in advance.