I have a multiuser database which VBA to return the current users NT
logon. The database has a table which contains the names of all users
and a field called bmlogon which holds their NT logon. The database
is used to track admin tasks. to add a new task the user first
selects the type and then clicks a command button to go to the form
for entering the details. The on current property of the main form
(for entering details) takes the type from the previous form and
updates a field. Part of the dataentry involves the user selecting
their name from a combo box.
Rather than selecting their name I was hoping that I could
programatically set the combobox based on a match between NTlogon from
the module and Nt logon from the table. I have made various attempts
starting with : -
Me.cmbrelmanid.DefaultValue = Nz(DLookup("relmanname", "tblrelman",
"[relmanlogon] = " & Chr$(34) & Me.[User1] & Chr$(34))) where
Me.User1 pulls the logon
' Me![cmbrelmanid].[Column](1) = DLookup("[relmanname]",
"tblrelman", "[relmanlogon] ='" & NTUser() & "'") where NTuser is the
coding that grabs the NT logon.
I have also tried placing the dlookup sections in default value.
I kept getting a 64479 error until I put the single quotes in but then
get an undocumented error 2147352562.
Anyone see where I am going wrong