outOfMyDepth
Jan 5 2005, 02:50 PM
In my database I have a deliveries form where data such as Client, Supplier, Order Number, Container Number, Handler etc. are recorded. It is not unusual to have to enter the same data up to ten times with only subform details changing.
My question is this. Is it possible to copy combobox and text field data by using code and then repopulating the blank form with this?
Ideally I'd like a button that copies six fields and another button that fills in the same blank fields with the copied data on a data entry form.
Any suggestions greatfully received.
oOmd
LittleViews
Jan 5 2005, 03:17 PM
Welllllll, as long as the fields are alive and well on your forms, whether they are visible or not, you can copy from one place to another.
me.myEmptyField = me.myDataLoad.column(3)
I am not sure what you are doing with your buttons, as one can do everything. You might be running a query or two, however, when you click a button. No matter where that data is - in a combo box, a single field, or nested in a query, you can get at that data and pass it on.
You need to know the syntax for transfering data from one form to another, of course, and you also need to test to see if the forms you need are open.
I hope this helps.
outOfMyDepth
Jan 6 2005, 01:37 PM
Thanks for the comprehensive reply Larry
The second post looks like the one for me.Frustratingly the computers at work where the db's used don't reference the DAO3.6 Object Library. The "Reference" option is disabled in the VBA tools menu.
So when I inserted the code I get a failed function.
Ricky's code didn't work unfortunately.
Is it possible to have a button on the form that copies the fields I need and another button that pastes the data so I can control when data is carried over?
Regards
oOMD
Larry Larsen
Jan 6 2005, 01:50 PM
Hi
I did see some where you could use the copy & paste commands but if I remember not at that aggressive level, just another option you could write the values to a temp table and call the back on the new form.