Let me explain a bit more.
I was given the project of creating a time sheet that includes reporting and tracking for holidays, Days off, Travelers etc, and allows for additon of new people while being protected so that only managment can change and see all the Access objects.
The main form has several options for the user and the command buttons on the form do things for the user and managment. Most of this has already been completed but some of the coding is figting back.
There are a few pieces of code that are messing with me - in part because I don't use Access 2007 often and in part because I haven't coded in Access or SQL for the better part of 4 years.
The three pieces that are giving me trouble are the combo box that has the last name and first name from the Name_List_Table, hiding and unhiding things for managment (with password protection) and updating specific fields as the command buttons on the main form are clicked.
The main form shows "last name, first name" for a combo box so the user can select their name. The names are from the Name_List_Table which holds things like first and last name, employee ID and so on. The Name_List_Table is created as employee information is entered by managment.
So here is an example -
A user opens the main form and the list of names for the combobox is populated from the Name_List_Table. Then they click on the start of day button on the main form which will put the name selected in the combo box into the Time Table, along with a date stamp for today, a time stamp showing when the button was clicked and the users system name.
So using our example of the start of day button, I am trying to get the computer users logon into the Time_Table where the first and last name, employee ID and the date stamp all match.
This is what I have so far however for each change there are a crapload of different probelms that come up.
For this code I either get a message that says Microsoft cant find the field "|" or if I take away [ ] it says the variable isn't defined.
sSQL = "update Time_Table "
sSQL = sSQL & "Set Day_Start_Entered_By = '" & Logon_UserName & "' "
sSQL = sSQL & "Where date_stamp = #" & Date & "# and " & [Name_List_Table]![Last_Name] & ", " & [Name_List_Table]![First_Name] & "= "
sSQL = sSQL & "[Time_Table]![Last_Name] + "", "" + [Time_Table]![First_Name] and [Name_List_Table]![Employee_ID] "
sSQL = sSQL & " = [Time_Table]![Employee_ID] ; "