The parent and sub forms below function fine however when I close the database it requests Parameters:

Pick Category combo box populates from select query for Category names
When the category has been selected it populates the Pick Site combo box with the sites related to that category.
The end user then picks a start date and an end date.
The MealStartDate and MealEndDate fields are not bound.
The end user then clicks the Find Meals button and the following code executes fine.
Code:
Private Sub CmdFindSchMeals_Click()
Dim dtstart As Date, dtend As Date
dtstart = Me.MealStartDate
dtend = Me.MealEndDate
If IsNull(Me.CmbPickCat) = True Then
MsgBox "You must pick a Category first.", vbOKOnly + vbExclamation, "Pick Category"
Exit Sub
Else
End If
If IsNull(Me.CmbPickSite) = True Then
MsgBox "You must pick a site first.", vbOKOnly + vbExclamation, "Pick Site"
Exit Sub
Else
End If
If IsNull(Me.MealStartDate) = True Then
MsgBox "You must pick a Start Date first.", vbOKOnly + vbExclamation, "Pick Start Date"
Exit Sub
Else
End If
If IsNull(Me.MealEndDate) = True Then
MsgBox "You must pick an End Date first.", vbOKOnly + vbExclamation, "Pick End Date"
Exit Sub
Else
End If
If (dtend < dtstart) = True Then
MsgBox "Your end date is earlier then your start date. Please correct your date range.", vbOKOnly + vbExclamation, "Correct your Dates."
Exit Sub
Else
End If
Me.Refresh
End Sub
The sub form refreshes with the correct data.
The sub form datasheet is based on a select query. The query is in the access query builder but I have included it her in SQL for simplicity.
SELECT Tbl_ScheduledMealItems.DayAssigned, WeekdayName(Weekday([DayAssigned])) AS [Day], Tbl_ScheduledMealItems.MealName, Tbl_ScheduledMealItems.ItemName, Tbl_ScheduledMealItems.VendorName, Tbl_ScheduledMealItems.IUDescription, Tbl_ScheduledMealItems.PriceperUnit, Tbl_ScheduledMealItems.InventoryID, Tbl_ScheduledMealItems.Category, Tbl_ScheduledMealItems.SiteName, Tbl_ScheduledMealItems.ScheduledMeal3ID
FROM Tbl_ScheduledMealItems
WHERE (((Tbl_ScheduledMealItems.DayAssigned)>=[Forms]![Frm_Main]![Frm_SiteCategorySelection].[Form]![MealStartDate] And (Tbl_ScheduledMealItems.DayAssigned)<=[Forms]![Frm_Main]![Frm_SiteCategorySelection].[Form]![MealEndDate]) AND ((Tbl_ScheduledMealItems.Category)=[Forms]![Frm_Main]![Frm_SiteCategorySelection].[Form]![CmbPickCat]) AND ((Tbl_ScheduledMealItems.SiteName)=[Forms]![Frm_Main]![Frm_SiteCategorySelection].[Form]![CmbPickSite]))
ORDER BY Tbl_ScheduledMealItems.DayAssigned;
The sub form functions fine and refreshes with the correct information.
But when I close the database I get four "enter parameter" boxes asking for the data from the query:
StartDate
EndDate
PickCategory
PickSite
The message on the parameter box specifies this form and these exact fields.

It's like it is trying to run the query again when I exit the database and can't find the parameters. I have this type of functionality elsewhere and have no problem.
I cannot figure out why this is happening or how I can prevent it.
Also I see people in the forum putting their code in nifty little scroll boxes so it doesn't take up as much space. How do you do that?
Phred
The graphic below is not a part of my post. I don't know how to get rid of it. Please ignore.