trouble with default value for a control

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

Guest

I have a form frmClntsAgents for which the Record Source is qryAgents which
filters the table tblGlobalClnts for the value “agent†in the ClientType
field in a related table tblClientType - tblClientType has two fields:
ClientTypeID and ClientType.

A combo box control cboClientType on the form allows the value “agent†to be
selected from the drop-down list. And this works fine. But I want to automate
things by making “agent†both the default value for this control AND have
that default value entered in the control each time a new record is added.
Then I can simply hide the control and let the value be entered behind the
scenes for new records.

But I can’t get this to work. The combo box is fine, but I can’t get the
control to automatically pick up the default value.

I’d like to try some sort of Event expression for the control but I’m not
sure where it should go, and I don’t yet know enough VBA to write the code.

Any suggestions gratefully received!
 
If you want:
* every record to hold the ClientTypeID for "agent"
* no ability to select another type
why bother even having a combo box? You could add a (hidden) text box on
your "agents-only" form and use a default value of the ClientTypeID. All
newly-created records would have that value.

To update the old records that need it, you could create an update query
(but I'm not sure how you'd know which ones were "agents"?<g>).

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


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

Microsoft Registered Partner
https://partner.microsoft.com/
 
Thanks Jeff, that solves my problem. It's working fine now.

I did try this before but my mistake was to try to get the control to
default to the display field "ClientType" rather than the actual bound field
ClientTypeID.
 
Back
Top