Using vba to add record from one to other table

  • Thread starter Thread starter Karen
  • Start date Start date
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
 
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.
 
Back
Top