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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble with option group

Status
Not open for further replies.

newbiess

Programmer
May 23, 2003
10
CA
hi everyone....
i'm a newbie at access so just wondering if anyone can help me out.

my situation is like this.
i've created an option group that contain 2 check box ...1 is for things being late and the other one is for things not being late. Now instead of making the person who enter the data figure this out. i've decided to have a constraint in that i check for today's date and compare it with the due date...if it's due then it's automatically selected the correct box...now i'm not very sure if there is a function that will allow the computer to do this automatically...so can anyone help me out.


thanx a whole lot
 
As the form opens in the Form_Load event you put the code something like :

dteToCheck = CDate("10 May 2004")
If now<dteToCheck then
frmOptions = 1
else
frmOptions = 2
End if

set dteToCheck to the date (pull from table?)
frmOptions is the option groups frame name.


Vince
 
thats exactly what i did and i did it in the after_update and on the On_enter event and it still didn't update...
i'm using microsoft access 97

thanx
 
oh another thing ...i tried to debug this and the condition seems to work but then getting the box to update does not seem to work any suggestion?
 
Here's one way to compare dates:

Code:
Private Sub DateClosed_LostFocus()
If Me.DateClosed < DateOrdered Then
'If DateOrdered is earlier than DateClosed, 
'this procedure is used
    MsgBox &quot;Date closed must be equal _
    to or later than date ordered!&quot;, _
    vbOKOnly, &quot;Incorrect Date Closed&quot;
    Me.DateClosed = &quot;&quot;
'Clears DateClosed control on the form
    Me.DateClosed.SetFocus
End If

Judge Hopkins


There are only two rules for success: (1) Never tell everything you know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top