By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,466 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Loading Access form with text box using autonumber

P: 4
I'm modifying an Access 2000 database created by a co-worker who is no longer with the organization, and is trying to figure out one part of the program. The database has two tables, tblemployees and tblCorrectiveAction. The tblemployees has fields ENAME, UserID, and a few others. TblCorrectiveAction has an autonumber field named Corrective Action ID, Originator, OrigDept, DateofCA, and several other fields. Then there is a form that has text boxes bound to Corrective Action ID, Originator, OrigDept, and DateofCA. When the form opens, the program looks for the currentuser (logged-in to the computer) and matches the UserID to print the Originator. Then, it fills in the DateofCA and OrigDept. How does the program look at the autonumber field (Corrective Action ID) and fill in the highest number?

The person is using
Expand|Select|Wrap|Line Numbers
  1. Sub AssignName()
  2. If Not IsNull(DLookup("[ENAME]", "tblEmployees", "[UserID] = ... etc as part of initial lookup.
  3. Me!txtOriginator.Text = DLookup("[ENAME]", "tblEmployees", "[UserID] =
  4. more lines ....
  5. End If
  6. End Sub
Jan 13 '07 #1
Share this Question
Share on Google+
2 Replies


NeoPa
Expert Mod 15k+
P: 31,263
Anekwe,
  1. Please remember to use code tags when posting a question (As per REPLY GUIDELINES at the right).
  2. Are you asking how generally to do it or are you asking someone to work out how your erstwhile colleague did it in his code?
Jan 13 '07 #2

NeoPa
Expert Mod 15k+
P: 31,263
BTW - If it's the latter you're asking then all the (relevant) code would be needed. I had a look at what you posted and you've chopped out some of the important bits :(
Jan 13 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.