Microsoft Office ACcess can't find the field '|' referred to in yo

P

Pwyd

expression.


Is the only reason for this particular statement by access when you've
mispelled a fieldname or something? i have this in vb in an afterupdate
statement:

[VendorRecordsTable]![V_RecipientsName] = [VendorDataQuery]![Recipients Name]

both are valid fields, i've checked and rechecked the fieldnames and
table/query names in question.
 
D

Douglas J. Steele

You can't refer to tables and fields in VBA like that.

What's the rest of the code look like?
 
P

Pwyd

I left something out, and so i need to revise my question:

How does one get the current record number thats being used by the form, in
a way that would be meaningful for assigning new data into that record?

What i'd like to do is using a query that already exists, select the rows
from that query and assign them into the table, for the current record.
 
D

Douglas J. Steele

Access doesn't really work with the concept of "current record number".

If you're dealing with a record, you should be able to determine its primary
key and use that.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Pwyd said:
I left something out, and so i need to revise my question:

How does one get the current record number thats being used by the form,
in
a way that would be meaningful for assigning new data into that record?

What i'd like to do is using a query that already exists, select the rows
from that query and assign them into the table, for the current record.


Pwyd said:
expression.


Is the only reason for this particular statement by access when you've
mispelled a fieldname or something? i have this in vb in an afterupdate
statement:

[VendorRecordsTable]![V_RecipientsName] = [VendorDataQuery]![Recipients
Name]

both are valid fields, i've checked and rechecked the fieldnames and
table/query names in question.
 
J

John W. Vinson

How does one get the current record number thats being used by the form, in
a way that would be meaningful for assigning new data into that record?

Since Access does not have or use record numbers, the only valid answer is You
Can't Do It That Way.

You can base a form on a Query selecting a specific record; set the form's
Data Entry property to Yes so you can add new records to the table (and not
see old ones); or add some simple code to jump to a chosen record (on the
basis of data existing in the record) or to the new record.
 
P

Pwyd

All right. Can one assign the results of a query via dlookup to an already
existing table, in a new record, programattically?
 
P

Pwyd

Or, in updating an already existing record? I've had great trouble using
update queries that draw on more than one source, regardless of what type of
source it is.
 

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