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

Trouble with fields saving to table

Status
Not open for further replies.

pbrown2

Technical User
Jun 23, 2003
322
US
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
 
Make the line of code prior to DoCmd.GoToRecord , , acNext
DoCmd.RunCommand acCmdSaveRecord


Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top