VBA/Linking Tables

  • Thread starter Thread starter J
  • Start date Start date
J

J

I have a project table that I need to be able to link to a status form.
I need something that will take 2 fields in the project table,
multiply them together and then create that number of lines in the
status form where data will be entered about the project.

I also need something that will take a Project number add on the
drawing number and then add on a number from 01 up to the amount of
lines there are on the status form. This number is different for every
record so there is no standard number to use.

I was just wondering if this code is correct for assigning a table
value to a variable:

Description =
![Project]![Description]

If not some help with this would also be nice. I'm trying to remember
this information but havn't dealt with this sort of thing in quite some
time now. Any help is appreciated.
 
J,

No, the syntax
![Project]![Description] is not valid. Even if
Access were able to understand this, you would still need to specify
which record in the table you are talking about... even if there is only
one record in the table.

I would recommend to not name a variable the same as the name of a field.

Try this...
strDescription = DLookup("[Description]","Project")

(this will use the value of the Description field in the first record in
the Project table.)
 
Back
Top