In the form there is a textbox "Name" which needs to hold the Name of the person according to their NetworkID. Therefore, I used the following on the On Open of the form (I have included all notes I made in the code):
'Following fills in the textbox "NetworkID", which is not visible with the user name of the network
[NetworkID] = Environ("username"
' Following looks from the table tblusers, which is filled out when the user logs on for the first time.
' It takes the "NetworkID" from above, compares it to the [UserID] and returns a concatination of the fields [FirstName] & [LastName] into the textbox "Name"
Forms![Problem]![Name] = DLookup("[FirstName] & ' ' & [LastName]", "tblUsers", "[UserID] = '" & [NetworkID] & "'"
The problem is that "Name" never updates the field [Name] in the underlying table named "Problem"
For reference at the bottom of the form the following code attached to a button sends the form to the coordinator when clicked (all notes included):
' Since from testing it has been found that unless you go to the next record to save the items in the form and return to the record, the form that is sent is blank
DoCmd.GoToRecord , , acNext
DoCmd.GoToRecord , , acPrevious
DoCmd.SendObject acSendForm, , acFormatXLS, Me!, , , "Captial Budget Item Change Request", , False
"Name" is coming through and showing in the e-mail sent out but not being saved to the tabel in the field [Name].
Any ideas????
Thank you for any and all help,
PBrown
'Following fills in the textbox "NetworkID", which is not visible with the user name of the network
[NetworkID] = Environ("username"
' Following looks from the table tblusers, which is filled out when the user logs on for the first time.
' It takes the "NetworkID" from above, compares it to the [UserID] and returns a concatination of the fields [FirstName] & [LastName] into the textbox "Name"
Forms![Problem]![Name] = DLookup("[FirstName] & ' ' & [LastName]", "tblUsers", "[UserID] = '" & [NetworkID] & "'"
The problem is that "Name" never updates the field [Name] in the underlying table named "Problem"
For reference at the bottom of the form the following code attached to a button sends the form to the coordinator when clicked (all notes included):
' Since from testing it has been found that unless you go to the next record to save the items in the form and return to the record, the form that is sent is blank
DoCmd.GoToRecord , , acNext
DoCmd.GoToRecord , , acPrevious
DoCmd.SendObject acSendForm, , acFormatXLS, Me!, , , "Captial Budget Item Change Request", , False
"Name" is coming through and showing in the e-mail sent out but not being saved to the tabel in the field [Name].
Any ideas????
Thank you for any and all help,
PBrown