Required entry

  • Thread starter Thread starter Guest
  • Start date Start date
Matt, sorry if I seem condescending, but you've been doing a terrible job of
describing how your application works.

Most of your posts implied that you were forcing the agents to pick their
name from a combo box that contained the names of the agents, and that each
agent was only allowed to pick his/her own name. If that's the case, you
shouldn't be using a combo box at all: you should have the query return
details only for the current user.

If your form has a control named cboAgent on it, you'd put in code:

If IsNull(Me.cboAgent) Then
MsgBox "You must pick an Agent."
Else
DoCmd.OpenReport...
End If
 
Doug,

I apologise. I can tell as I am typing it that it is a crap explanation, it
is just difficult to get my point across. You have got the jist of it yes,
but unless I have the Agent ID selected in some way, it does not update to
the reports for some reason beknown to me.

Under what section would I enter this code?

Matt
 
In one place, you mentioned that you're using CurrentUser(). Does this mean
you've applied Access User-Level Security? (CurrentUser only returns
something useful if you have: otherwise, it returns Admin for each user)

If you have applied Access ULS, you should be able to put CurrentUser() as
the criteria for the Agent ID field in your query, and it will only return
details for the current Agent.

If you haven't applied Access ULS, and what you really want is the network
ID, take a look at http://www.mvps.org/access/api/api0008.htm at "The Access
Web". You would then specify fOSUserName() as the criteria in your query.
 
Back
Top