Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving to 2 fields with same name in VB select statement (DAO)

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
Hello,

I'm using Access 97 with VB 5.0 using DAO and the Jet. I have a select statement that inner joins two tables. There are fields in both tables with the same name. How do I reference them to save info to the fields with same names in the recordset?

With datInfo.Recordset
.Edit
!TransDate = Date
!TransDate = Date
.Update
End With

Thanks For Your Time,

Dave
The 2nd mouse gets the cheese.
 
If BOTH of the fields are in your result set, which I assume is your "datInfoRecordset" guy, you can prefix the recordset name of the field with the source table name of the field:

With datInfoRecordset
.edit
Table1!Transdate = Date
Table2!Transdate = Date
etc etc etc...

If you examine your output recordset, you'll see that Access will name the fields thusly to keep them separate.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top