From: Daryl S on
Steve -

If the form is not open, then the query will prompt for the values, though
the prompt will be something like Forms!formname!controlname - as the
developer you will recognize it.

--
Daryl S


"Steve Stad" wrote:

> Thanks Daryl - that is one solution. But sometimes I run the query from the
> query design window and prefer to type in MIL or CIV in the parameter window.
> Can I overide the CIV MIL in the option group on the form if I run it from
> w/i the Query Design mode. The idea is to prevent fat fingering and typing
> CVI which causes the parameter query to run nothing or nulls.
>
> "Daryl S" wrote:
> > Steve -
> > You could put an option group on the form next to the report button that
> > lets them only choose MIL or CIV. Then for the parameter query, change it to
> > pull the value selected in the option group from the form.
> >
> > --
> > Daryl S
> >
> >
> > "Steve Stad" wrote:
> >
> > > I have a button on a form to open a report based on a parameter query. The
> > > button activates the parameter query and the parameter msgbox says enter MIL
> > > or CIV. I would like to ensure the user spells MIL or CIV correctly so the
> > > parameter query runs correctly everytime. The current button code is below.
> > > Can you tell me how to add/edit or redo code to force user to spell MIL or
> > > CIV correctly. For example with if statement ..If input box <> "CIV" and
> > > inputbox <> "MIL" then msgbox "You Must spell MIL or CIV correctly"
> > >
> > > Private Sub MILCIVPercentCompRep_Click()
> > > On Error GoTo Err_MILCIVPercentCompRep_Click
> > > Dim stDocName As String
> > > stDocName = "Rep_CompletenessMIL&CIVPerc"
> > > DoCmd.OpenReport stDocName, acPreview
> > > Exit_MILCIVPercentCompRep_Click:
> > > Exit Sub
> > > Err_MILCIVPercentCompRep_Click:
> > > MsgBox Err.Description
> > > Resume Exit_MILCIVPercentCompRep_Click
> > > End Sub
> > >