Required entry

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I currently run a form in which an Agent enters and picks their Agent ID from
a drop down combo list.

This list is limited to one person as it is set to only show the current
user. However, it starts as a blank and agents keep forgetting to enter their
ID. Is their anyway of making this a required field. Entering required in the
table does not work. I was thinking of some form of "IsNotNull" formula but
was unsure where to enter it.

Many THanks
Matt
 
Matt

Maybe I'm missing something...

It sounds like your application already "knows" who it is (CurrentUser).
Why are you forcing the Agent to identify him/herself from a list of one?!

You could consider pre-loading the form with the CurrentUser. That would
save your Agent some work, and ensure that you capture the data you need to.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
Well a default value cannot apply to a current field even if it is blank?

The combo box starts with a blank and only has that from the list, so they
still have to click the box to select their ID.

So therefore i need this error to occur ifthe field is left blank

Matt
 
Why not make the default value of the text box CurrentUser? That way, the
field will automatically be populated when a new row is created.
 
The record is not a new one, so when a current record is searched for and
pulled out, the setting is set to blank again.

If i try it for list box, the relevant reports do not update and the Agent
Id appears blank for some reason.

ANy ideas as for this error message?

Matt
 
Sorry, you're not making any sense to me.

You say you have "a form in which an Agent enters and picks their Agent ID
from a drop down combo list.". Rather than making them pick their ID from a
combo box, why can't you determine who they are, and prefill a text box (or
select the entry from the combo box)?
 
The agent enters the form and selects their Agent ID from the drop down list
box.

However, theirs is the only ID they can select as the control source is set
to currentuser. When they search for a record, the ID does not automatically
select this ID, it is blank and they have to select it. Some agents are
forgetting to do this and therefore the reports do not look correct.

How do i get the form to producean error report if this is left blank?

Matt
 
Check whether the value of the combo box is Null. I still don't understand,
though, why you make them select from a combo box if they're limited to
choosing a single, known value from that list!
 
Because for some reason, when i make it a list ox and the data is already in
there, it does not show in the report unless they select it. Therefore it
doesnt make much difference either way. Makes more sense to select their name
via a combo box i feel!
 
It doesn't make more sense to select from a combo box to me.

Selection should only be made when there's something to select. If they're
only allowed a single value, you shouldn't be forcing them to select: you
should be providing their ID to the query through a function. (WHERE UserID
= CurrentUserId(), where CurrentUserId is a function that returns who they
are)

If there are certain "superusers" who can query on anyone, then maybe it
makes sense to allow them to choose from a combobox, but you should
preselect the current user's ID from the list. You can do this in the form's
Load event using something like:

Me.MyComboBox = CurrentUserId
 
Matt

I'll chime back in here...

Doug's point, like mine, is that you don't (unnecessarily) force users to do
things that the computer can do for them. Selecting from a list of one is
an example of a user-surly feature.

Do you want to make it easier for folks to do what they value, or do you
want to force them to do things that, from their point of view, adds no
value?

Sorry if that comes off a bit testy -- this is one of my hot buttons...

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
Basically, agents are forgetting to select their Agent ID in the form and if
i make it a list box, even if default value is currentuser, it says the name
but does not bring it up in the report unless the box is clicked.

All I want is the Agent ID field is automatically selected to the current
user and the report updates with this or an error message occurs when the
message is left blank!
And at the moment, i keep getting blanks in this field where they are
forgetting

Matt
 
Matt

Thank you! You've just made my point. YOU want the ID so you can see it in
a report. The Agents could care less, so they're forgetting to do it.

So why force them to? If your application already knows who is using the
computer (and it MUST, since you said you use CurrentUser to limit the list
to a single Agent), have your computer enter the Agent behind the scenes.
No need to even show the field ... after all, the Agent already knows who's
using the computer, too!

Doug offered a mechanism for automatically entering the value ... does that
work for you?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
Jeff,

If i do this, it still gives me a blank in the report where Agent ID would
go. The name appears but unless i highlight it i.e. click it, it still gives
me a blank value.
Hence I use a combo box to try to remind them not to leave it blank!

I have this entered in the form onload :

Me.Agent_ID = CurrentUser()

Matt
 
I am referring to it is Agent ID but this works for when the agent has been
selected from the one list combo box!

Again confused!
 
That doesn't really tell me anything.

Are you referring to the control on the form, or to a field in the
recordsource? You should be referring to the field in the recordsource.
 
I am referring to the combo box as Agent ID in the report. When i update from
the combo box it works, yet if I have a list box and the name still appears,
it does not appear in the report unless the name is highlighted by the user.
Is there anyway of getting an error message to appear, as this way does not
seem to work at all.

Matt
 
Since you're limiting what records are returned to the report, get AgentId
from the recordsource, not from the combo box.

How do you launch the report? Presumably you have a button that has
DoCmd.OpenReport somewhere in its Click event. Simply put a check whether
the value of the Combo Box is Null, and don't launch the report if it is.
 
Ok, now I think we have crossed wires.

The report is launched from a swtichboard i have installed. The report has
many agents in it though and it has to run even if one or two agents have
forgotten. The report is only accesible by three users and there are a
further 8 agents below that.

Is there no definite formula which can just say, If Agent ID is Null, Then
not allowed to leave form?
 
Back
Top