Copy data from form field to another table

  • Thread starter Thread starter T Smith
  • Start date Start date
T

T Smith

I have a unbound field on a form which returns data from another table using
a Dlookup function. How could I go about writing or copying the data that is
returned by the Dlookup call to a field in the table the form uses as its'
control source?

Thanks in advance.
 
Hi,
I guess the easiest way for you would be to have another text box that's
bound to the field you want, then just set it's value (in code) to the unbound one.
 
Since I am an access rookie, I am not familiar with using code. Would you be
kind enough to explain how to do it or is there another process available
without using code?

Thank you.
 
Hi,
The code is pretty simple.
It goes in the Current event of the form.

In the form's property sheet, go the event tab.
In the On Current event, select [Event Procedure]
and then click on the elipsis (...)

This will bring you into the vb editor.
Now enter this, substituting your control names:

Me.NameOfBoundControl = Me.NameOfUnboundControl
 
I am having a little difficulty. Could you please indicate the syntax. I
know nothing at all about VB. The name of the form control is "forms!entry
log!vendor phone" the name of the table where the information needs to be
written is "tables!key log!vendor phone number". How should the script read?

Thanks for any help.
 
Back
Top