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

Enabling a CheckBox

Status
Not open for further replies.

jdwm2310

Technical User
Jul 26, 2001
396
US
Hi Guys,

I have a form called frmOpenTickets, a user encounter this form from a menu list. This form stores all the tickets that have a ticketstatus of "Open". The user would open this form if he/she decides to close the ticket. On form I added a checkbox stating that "Please check to close this ticket once you received notification from specialist."
This checkbox is not enabled. It would only be enabled if the RouteTo field is filled in with data.
I can't get the checkbox to turn enabled, please look at my code probably I am doing something wrong..thanks

Private Sub Check158_Click()
If Me.Route_To = " " Then
Me.Check158.Enabled = True
Me.Check158.SetFocus
Me.Date_Closed = Now()
Me.TicketStatus = "Closed"
Me.Lock = True

DoCmd.Close acForm, "HelpDeskCalls", acSaveYes
DoCmd.OpenForm "TicketOption"
MsgBox "The ticket is saved", vbInformation
End Sub
 
Not sure if I'm understanding this correct but the checkbox needs to be enabled before the Onclick event can be used I think it should read

If IsNull(Me![Route_To]) Then
Me.Check158.Enabled = False
Else:Me.Check158.Enabled = True
Me.Check158.SetFocus

Endif

This would be placed in the AfterUpdate event of the Route_To control

The following would then be placed in the OnClick event of the checkbox.

Me.Date_Closed = Now()
Me.TicketStatus = "Closed"
Me.Lock = True

Hope I have understood you correctly and this helps
 
Bigsteve42,

Let me explain what I am doing. I have a form call frmHelpDesk. the users use this form to enter tickets. If they click on Route to, the ticket status is "Open". If the user would like to see that "Open" ticket. They go to the Main Menu. In the Main Menu there is an option labeled "View Open Tickets". when the user click on this option the frmPendingTicket will open. So some of the tickets will have the RouteTo field occupy with someone's name or it will be blank. If the RouteTo field is filled the only click will be on the CheckBox. IF the RouteTo field is blank than they do not have the option to click on the checkbox.

I did what you said and it doesn't seem to work, am I doing something wrong???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top