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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Go to next entry on Table field lookup

Status
Not open for further replies.

timotai

Technical User
Apr 13, 2002
119
GB
Hi all

I have a table and in one of its fields for the records there is a lookup into another table. Everyweek I want to change the entry for all the records to this field to the next one in the list. The question is how? I have seen VBA coding for doing this for combo boxes on a form but I need to do it within the table. Can anyone help

Many Thanks

Tim
 
Hi mister Tom,

I'm confusing about ur explanation, but I hope u mean something like this.
The lookup table is saved as ID, description
So u can change the field in the table with a update query
strSQL = "UPDATE table SET fldLookup = fldLookup + 1"
docmd.runsql strSQL
It only works when the lookup table is in the right order of numbers
U can limit like this:
If fldLookup > 10 then
strSQL = "UPDATE table SET fldLookup = 1"
else
strSQL = "UPDATE table SET fldLookup = fldLookup + 1"
end if
docmd.runsql strSQL

Hope it helps,
Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top