Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

getting a compile error not sure why

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
babs - 17 Mar 2008 22:31 GMT
I have written an event procedure for after the cost combo box is selected
that if the value is NOT equal to 0 I do not want the field truckhours to be
able to be input and if it is 0 they truck hours can be input.

Private Sub cbocost_AfterUpdate()
If (Me.cost) <> 0 Then
Me.TruckHours1.Enabled = False
Else
Me.TruckHours1.Enabled = True
End If
End Sub

not sure what I have wrong
thanks,
Barb
Douglas J. Steele - 17 Mar 2008 22:38 GMT
It would help to know the exact error message you're getting.

However, you imply that decision is based on what was selected in the combo
box. In one place, the combo box is called cbocost, in the other, it's
simply cost. Try changing

If (Me.cost) <> 0 Then

to

If (Me.cbocost) <> 0 Then

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

>I have written an event procedure for after the cost combo box is selected
> that if the value is NOT equal to 0 I do not want the field truckhours to
[quoted text clipped - 12 lines]
> thanks,
> Barb
Beetle - 17 Mar 2008 22:40 GMT
The name of your combo box appears to be cbocost, so it would need
to be;

Private Sub cbocost_AfterUpdate()
If (Me.cbocost) <> 0 Then
Me.TruckHours1.Enabled = False
Else
Me.TruckHours1.Enabled = True
End If
End Sub

Signature

_________

Sean Bailey

> I have written an event procedure for after the cost combo box is selected
> that if the value is NOT equal to 0 I do not want the field truckhours to be
[quoted text clipped - 11 lines]
> thanks,
> Barb
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.