Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aaaagh!! Form Prompt!

Status
Not open for further replies.

Rjc8513

Technical User
Feb 12, 2001
140
US
[MainForm] not bound to any record source.
[ComboBox] on [Main Form] record source is [IDNo Table].
[MainQuery] field [ID No.] references [ComboBox].
[TextBox1] on [MainForm] record source is [DateTable].
[TextBox2] on [MainForm] record source is [DateTable].
[MainQuery] field [Date]= Between [TextBox1] And [TextBox2].
[SubForm] record source is [MainQuery].
[GetData] command button refreshes [SubForm].

What I am trying to do is open [MainForm], have the user select an ID No. from [ComboBox], select a start date from [TextBox1] and an end date from [TextBox2]. Then click [GetData] and have the requested data appear in [SubForm].

I have it working except, when I open [MainForm] I immediately get prompted for [ID No]. Why can't [MainForm] just open without the prompt?

Rjc8513

 
[MainQuery] field [ID No.] references [ComboBox]
[SubForm] record source is [MainQuery]

When you open the form (with the subform) the query is run immediately, therefore the ID No. is needed and prompted for. Try setting a default value for your combobox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top