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

Need a Little Help With Procedure Termnology and Ehich Event to Use?? 1

Status
Not open for further replies.

quest4

Technical User
Aug 27, 2001
735
US
I have a form with ten boxes on it, they work in sets. The boxes are: WorkDay1 and WorkDay1Reason thru WorkDay5 and WorkDay5Reason. The WorkDay1-5 box are text boxeswtih a default value already entered in them, while the WorkDay1-5Reason boxes are combo boxes set to blank or Null. The WorkDay1-5 text boxes all have tabcontrol's on them and nothing else does, because we move from text box to text box with thetab key. I am assuming that the procedures would all be entered in the OnLostFocus, but it could be OnChange, event, but I am not sure. What I would like to have happen is to be able to tab fromWorkDay1 toWorkDay2, if no changes occur, and in WorkDay2, let's say he is one hour late, type in 7.00 and tab, but instead of go toWorkDay3, I would like to go to WorkDay2Reason, instead and in the combo box have the defult like this, If WorkDay2>0 then 6 else 0. Those would be selection in the combo box, then I would like to be able to tab to WeekDay3 and resum the normal tab order. Thank you very much to anyone lending a help hand in my confussion.
 
It looks to me like you have chosen the appropriate choice. According to HELP, the OnChange event only fires when a manual change is made to the text box. At that point, I would use the SetFocus to go to your combobox. As to what you wanted automatically done to that combobox, I didn't really follow that logic, but I am sure you know what you want to do... Terry M. Hoey
 
Thanks for the quick response, but I dicovered the AfterUpdate in the text box works far better. So I got brave and tried the defaults in the combo boxs:
Private Sub WorkDay1_AfterUpdate()

DoCmd.GoToControl "WorkDay1Reason"
If WorkDay1 = 0 Then
WorkDay1ReasonCombo.DataItem (0)
Else: WorkDay1ReasonCombo.DataItem (6)

End If
End Sub
I keep getting an error 424, select object, and with that I am comfussed. Any suggestions on this one? Again thanks for the response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top