sparkyrose
Registered User.
- Local time
- Today, 08:32
- Joined
- Sep 12, 2007
- Messages
- 31
Hi all,
My Db has a form in which I'd like the user to be able to click a button to copy name and address details from an existing record to the current record. The idea is that the button opens a small data-collection form containing a combo, they select the source record by name (no need to review the data before updating), hit Ok, and the current record's name and address is populated.
I have the data-collection form but currently it runs a standard query which opens when you hit Ok, as per the following:
I don't want to view the query results, just put them into the current record. I assume I need this event to run a select query based on the value of the combo, and then update the current record with those values. I'm afraid I'm just not familiar enough with VBA to do that!
Any advice greatly appreciated.
MCR
My Db has a form in which I'd like the user to be able to click a button to copy name and address details from an existing record to the current record. The idea is that the button opens a small data-collection form containing a combo, they select the source record by name (no need to review the data before updating), hit Ok, and the current record's name and address is populated.
I have the data-collection form but currently it runs a standard query which opens when you hit Ok, as per the following:
Code:
Private Sub btnOk_Click()
Me.Visible = False
DoCmd.OpenQuery "qryCopyAddress", acViewNormal, acEdit
DoCmd.Close acForm, "frmCopyAddress"
End Sub
I don't want to view the query results, just put them into the current record. I assume I need this event to run a select query based on the value of the combo, and then update the current record with those values. I'm afraid I'm just not familiar enough with VBA to do that!
Any advice greatly appreciated.
MCR