Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2007

Tip: Looking for answers? Try searching our database.

Combo box required

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BonnieW - 30 May 2007 15:51 GMT
I have a series of three forms, editing two tables.  In the first form, there
is a combo box in which the user selects a place name (where the work was
performed).  The user then has two choices (staff effort or volunteer effort)
in button format; they go to different forms.  

The place name (combo box) is required in the underlying table, but that
record is not "saved"  til about three forms down the road, so we don't hit
an error message til them.  Similarly, BeforeUpdate code isn't preventing the
user from moving to the next form, but in case I did something wrong:

Private Sub Form_BeforeUpdate(Cancel As Integer)
   If IsNull(Me!Combo25) Then
       MsgBox "You simply MUST choose a Natural Area!  All the cool kids are
doing it."
       Cancel = True
       Me!Combo25.SetFocus
   End If
End Sub

(I've set the DefaultValue for Combo25 to Null).

The combo box doesn't (I think) lose focus- the next logical step after
choosing a place (or not choosing it, as the unfortunate case may be) is to
hit one of the buttons leading to the next form.

How do I get this combobox to require data?

Thanks in advance!
BonnieW - 30 May 2007 15:54 GMT
Forgot to mention: the combobox is unbound, its rowsource is a query.
Carl Rapson - 30 May 2007 16:25 GMT
>I have a series of three forms, editing two tables.  In the first form,
>there
[quoted text clipped - 30 lines]
>
> Thanks in advance!
BonnieW - 30 May 2007 16:37 GMT
I actually managed to sort it out with an if...then...else statement in the
onclick of the buttons in question. Thanks!

>I have a series of three forms, editing two tables.  In the first form, there
>is a combo box in which the user selects a place name (where the work was
[quoted text clipped - 24 lines]
>
>Thanks in advance!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.