First of all I want to say thank you to everyone on here who participates. I have been amazed not only at the depth of knowledge that many of you have, but the willingness to help each other out. Through many of your posts I've put together a database that almost works! woo hoo!
I'm needing a little bit of help putting on the last touch with my database though. I have a login form that takes a user name and password, checks to make sure that they are correct, and then appends them to a table called "LocalUser". When the login form is started, a delete query runs and deletes everything in the table "LocalUser", and then the append query runs.
In my append query I have a DLookup expression finding a value from a field in another table.
DLookUp("[SalesID]","Employee","[Login] = [Forms]![Loginform]![txtlogin]"
Basically what I need written to the "LocalUser" table is the login, the user level, and the
SalesID. All of these are in the "Employee" table. All of this works just fine; where my problem comes in is that I need the SalesID number from the "LocalUser" table to automatically populate into a form called "Sales". But the SalesID also needs to be written to the "Sales" table. So to put it simply, what I need is to have the appropriate SalesID automatically populate for the user who is logged in so that they don't have to type it in with every order. That SalesID is used to run reports later finding out how many sales such and such person with that SalesID number had. It seems like such a simple little thing, but I'm just not getting it.
I've tried various ways to make it work, putting the default value for the Sales.SalesID field as the above Dlookup expression. That didn't work. I tried making the default value for the Sales.SalesID field as LocalUser.SalesID, but that didn't work either. I tried a to do a lookup field in one of the tables. Actually, I've tried so many wrong things that I don't exactly remember what I've done. Although I am fairly certain that I haven't done one thing, the RIGHT WAY TO DO IT!
Anyway, thanks to anyone who can help.
Michael