The date is in a popup dialog box, i input the date and then click on a open form button.
heres the code for the popup open form button:
--------------------------
Private Sub Open_Form_Click()
On Error GoTo Err_Open_Form_Click
Dim stDocName As String
Dim stCriteria As String
Dim indate As Integer
If IsNull(Me![StDrillDate]) Then
MsgBox "You did not enter a Start Drill Date. Enter one and try again.", vbOKOnly, "STARTING DRILL DATE ERROR"
DoCmd.GoToControl "stDrillDate"
Exit Sub
End If
'Test code to check for day of week
indate = Weekday(StDrillDate)
If indate = 6 Then
'MsgBox "Its Friday", vbOKOnly
ElseIf indate = 7 Then
'MsgBox "its saturday", vbOKOnly
ElseIf indate = 1 Then
'MsgBox "its sunday", vbOKOnly
Else
MsgBox "You must enter a Friday, Saturday, or Sunday Date", vbOKOnly, "ENTER A FRI, SAT, OR SUN DATE ERROR"
DoCmd.GoToControl "stDrillDate"
Exit Sub
End If
stDocName = "frmAttenPay"
DoCmd.OpenForm stDocName, , , , acFormEdit
Exit_Open_Form_Click:
Exit Sub
Err_Open_Form_Click:
MsgBox Err.Description
Resume Exit_Open_Form_Click
End Sub
----------------------
then the form opens with the following code in on_load:
-----------------------
Private Sub Form_Load()
Dim indate
indate = Weekday(Forms!dbxStDrillDate!StDrillDate)
If indate <> 6 Then
'MsgBox "fri show", vbOKOnly
'MsgBox "fri hide", vbOKOnly
Me![cbxFri1].Visible = False
Me![cbxFri2].Visible = False
Me!labFriday.Visible = False
Me!labPD5.Visible = False
Me!labPD6.Visible = False
End If
DoCmd.Close acForm, "dbxStDrillDate"
'DoCmd.Requery (Me!SECTION = "hq plt")
'DoCmd.GoToControl "Forms!frmAttenPay!cbxFindSection"
'"[section]='hq plt'"
End Sub
--------------------------------
The combo box lists the different sections and I would like it to default to Hq Plt, I think if i could get the form to open with a section already displayed, then the afterupdate with the update query would probably work when i selected another section or closed the form.
Again Thanks for all your help. (This is a diff. db than my other post, it could be sent to you if that would help, would have to send in the morning though, the most current copie is at work)