I just yesterday got a lot of help on this, and learned a bunch, but I guess not enough. See Thread705-1391485
I am trying to add the last string, but obviously DLookUp is not the proper format, or I am doing it wrong:
DoCmd.RunSQL "INSERT INTO tbl_Activities(EntityID, ActivityDate, ActivityTime, ActivityCode, ServerID, ActivityNotes)" _
& " VALUES (" & Me!txtEntityID & "," _
& "#" & Format(Now, "yyyy-mm-dd") & "#," _
& "#" & Format(Now, "hh:nn") & "#," _
& "'SA'," _
& "'" & Me.txt_DataEntryInitials & "')," _
& DLookup("ServerName", "tbl_Servers", "ServerInitials ='" & [cboServerID] & "'")
I am trying to add the last string, but obviously DLookUp is not the proper format, or I am doing it wrong:
DoCmd.RunSQL "INSERT INTO tbl_Activities(EntityID, ActivityDate, ActivityTime, ActivityCode, ServerID, ActivityNotes)" _
& " VALUES (" & Me!txtEntityID & "," _
& "#" & Format(Now, "yyyy-mm-dd") & "#," _
& "#" & Format(Now, "hh:nn") & "#," _
& "'SA'," _
& "'" & Me.txt_DataEntryInitials & "')," _
& DLookup("ServerName", "tbl_Servers", "ServerInitials ='" & [cboServerID] & "'")