Using vba to add record from one to other table

K

Karen

Hi Harry,

I'm no expert but I think something like this may work:

Dim strTable1MerchandiseType as String

strTable1MerchandiseType = txtMerchandiseType.value

If IsNull(dlookup("Table2","MerchandiseType","MerchandiseType = " &
strTable1MerchandiseType)) then

...........SQL to insert new MerchandiseType in Table 2

End If


Karen
 
H

Harry

I'm having the following problem:
I want copy or add records from a form with vba after update from one table
to the other table.
First table has a field that's called MerchandiseType
Second table has a field with the same structure.
I want from the form after update with DLookup check if the MerchandiseType
exist in the second table.
If not I want add this type of MerchandiseType from the form to the second
table.
Somebody has a resolution?
second table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top