The code is:
Private Sub cmdBuild_Click()
On Error GoTo Err_cmdBuild_Click
Shift = InputBox("Enter shift")
If Shift = "D" Or Shift = "S" Or Shift = "N" Then
If Shift = "N" Then
Shift = Shift & "*"
Else
Shift = Shift
End If
Else
Shift = "*"
End If
txtShift.SetFocus
txtShift.Text = Shift
pdate = InputBox("enter Production Start Date")
pdate = Format(pdate, shortdate)
pdate1 = Format(DateAdd("d", 1, pdate), shortdate)
If IsDate(pdate) Then
pdate = pdate
pdateyy = Format(pdate, "yyyymmdd")
pdate1 = pdate1
pdate1yy = Format(pdate, "yyyymmdd")
Else
pdate = Format(DateAdd("d", -1, Now()), shortdate)
pdate1 = Format(DateAdd("d", 1, Now()), shortdate)
pdateyy = Format(pdate, "yyyymmdd")
pdate1yy = Format(pdate, "yyyymmdd")
End If
txtStart.SetFocus
txtStart.Text = pdate
pdate2 = InputBox("enter Production Stop Date")
pdate2 = Format(pdate2, shortdate)
pdate3 = Format(DateAdd("d", 1, pdate2), shortdate)
If IsDate(pdate2) Then
pdate2 = pdate2
pdate3 = pdate3
pdate2yy = Format(pdate2, "yyyymmdd")
pdate3yy = Format(pdate3, "yyyymmdd")
Else
pdate2 = Format(DateAdd("d", -1, Now()), shortdate)
pdate3 = Format(DateAdd("d", 1, Now()), shortdate)
pdate2yy = Format(pdate2, "yyyymmdd")
pdate3yy = Format(pdate3, "yyyymmdd")
End If
txtstop.SetFocus
txtstop.Text = pdate2
order = "00000"
'Exit Sub
If MsgBox("Do you want to refresh the audit files? Do this first time you run for the day", vbYesNo) = vbYes Then
DoCmd.SetWarnings (warningsoff)
DoCmd.OpenQuery "xxxxxxxxxx", acViewNormal, acEdit
DoCmd.OpenQuery "xxxxxxxxxx", acViewNormal, acEdit
DoCmd.OpenQuery "xxxxxxxxxx", acViewNormal, acEdit
DoCmd.OpenQuery "xxxxxxxxxx", acViewNormal, acEdit
DoCmd.OpenQuery "xxxxxxxxxx", acViewNormal, acEdit
DoCmd.OpenQuery "xxxxxxxxxx", acViewNormal, acEdit
DoCmd.SetWarnings (WarningsOn)
MsgBox ("Files Updated Run Reports now")
End If
Exit_cmdBuild_Click:
Exit Sub
Err_cmdBuild_Click:
MsgBox Err.Description
Resume Exit_cmdBuild_Click
End Sub
After [MsgBox("Do you want to refresh the audit files? Do this first time you run for the day", vbYesNo) = vbYes] I get the enter parameter box.
In the criteria of one query I am using :
Like [forms]![main].[shift]
and this is the first parameter not recognized (calling up the enter parameter box).
The form works fine in my old Access database but not 2007???