Required field on form

Joined
Jun 18, 2016
Messages
1
Reaction score
0
Hello all

I wonder if any of you could help me with a simple thing which has been driving me crazy for several hours.

I have a form which opens as 'Add' (for new record)
The first field is called 'Admin_name' and needs to be filled in before the user can move on (it's a combo box)
The next field is called 'Client' (set by Tab order)
The primary key field is an Autonumber which doesn't populate until data is added anywhere on the form (everyone knows this of course).

I have tried absolutely everything I can imagine to make this happen: validation settings on both table and form, functions, macros and code (some of which I copied from this forum and adapated to my own form).
When I get Debug to smooth out any errors (I am an beginner really), the code just doesn't work. It's as though the conditions I'm asking for are not met. I can't see why.
I've tried triggering the code with command buttons, via On_Exit, On_Lostfocus etc events on both fields...whatever I try things don't happen the way I want them to.

I wonder if the problem is that until a new record is created none of the conditions work.
Having said that, if I populate another field to activate the new record, when I move back up into the admin_name field and leave it empty, STILL nothing happens.

The only time anything happens at all is when I try to close the form (or move back to design view) when the bog-standard Access messages kick in OR the Validation Rule text suddenly appears out of nowhere.
I don't really want these bog-standard messages at all, I want my own MsgBoxes to talk to the user. (Ideally at field level but at OnClose level if I have to).
And I want the user to get stuck in that field until he or she selects his name from the combo box list.

Is this too much to ask?

Many thanks if you've got this far...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top