mutually disabling feilds

Y

yadang

If two people come to the museum, and one person is from Overseas, but the
other one is local, I should have two combo boxes: one with the values set
to a list of countries for the ticket issuer to the museum to select, and
the other to a list of postcodes.

However, some ticket issuing staff have extremely limited experience with
computers, and they might accidentally enter both a country and a
postcode, which would create problems for our statistics.

Could it be that a way exists to connect the two fields together, so that
an entry in one field automatically prevents an entry being made in the
other?

yadang
 
K

KARL DEWEY

they might accidentally enter both a country and a postcode
Why not just 'Limit to List'?
 
J

Jeff Boyce

If your application requires "trained" or "savvy" users, it seems like it
will be discouraging or maybe even non-functional for average folks. Have
you looked into "user-proofing" your application so that the new user cannot
make mistakes?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson

Could it be that a way exists to connect the two fields together, so that
an entry in one field automatically prevents an entry being made in the
other?

Yes, you can use some code in each combo box's AfterUpdate event, and also in
the form's Current event, to disable or enable the combo boxes appropriately.
Assuming you have cboCountry and cboPostcode, you might use code like:

Private Sub cboPostCode_AfterUpdate()
If Me!cboPostCode & "" <> "" Then ' Did the user enter a postcode?
Me!cboCountry.Enabled = False
End If
End Sub

Private Sub cboCountry_AfterUpdate()
If Me!cboCountry & "" <> "" Then ' did they enter a country?
Me!cboPostCode.Enabled = False
End If
End Sub

Private Sub Form_Current()
' Enable or disable the combo boxes on a new or existing record
If Me.NewRecord Then
Me!cboPostCode.Enabled = True
Me!cboCountry.Enabled = True
Else
' enable the post code combo box if Country is null, and vice versa
Me!cboPostCode.Enabled = IsNull(Me!Country)
Me!cboCountry.Enabled = IsNull(Me!PostCode)
End If
End Sub
 
G

Gina Whipp

yadang,

I guess I'm not understanding the problem. Why not have both?

However, I have a situation where I only want one figure Age of Building OR
Year Built. To accomplish that, once they fill in one the other one becomes
unenabled.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 

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