C
Colin Walls
Hi Guys,
Been going round and round on this fairly simple thing.
All I want is for a button to be greyed out on a form if the week number exists in a table.
I've got a a table called week which has the column headings IDATE:WEEK
2 buttons:
Button1
Button2
And a form called "disablebuttons"
In my head this should happen:
When the form is opened and On Current event should run.
This event should look for the current date in the DATE column in table "week" then return that WEEK number.
Based on that it should then disable or enable a "button1" on the form.
This is what I have so far (I'm not exactly well versed in VBA):
Private Sub Form_Current()
If DCount("Week", "week") = "58" Then "<- this is the line annoying me"
Me.Button1.Enabled = False
Else
Me.Button1.Enabled = True
End If
End Sub
Any help would be greatly appreciated.
Cheers,
Colin
Been going round and round on this fairly simple thing.
All I want is for a button to be greyed out on a form if the week number exists in a table.
I've got a a table called week which has the column headings IDATE:WEEK
2 buttons:
Button1
Button2
And a form called "disablebuttons"
In my head this should happen:
When the form is opened and On Current event should run.
This event should look for the current date in the DATE column in table "week" then return that WEEK number.
Based on that it should then disable or enable a "button1" on the form.
This is what I have so far (I'm not exactly well versed in VBA):
Private Sub Form_Current()
If DCount("Week", "week") = "58" Then "<- this is the line annoying me"
Me.Button1.Enabled = False
Else
Me.Button1.Enabled = True
End If
End Sub
Any help would be greatly appreciated.
Cheers,
Colin