G
Guest
Hi - Am using Access ('02) to input a photo archive from a truck body
manufacturer. Have set up the following fields:
Reason (why photo was taken). Most pics are "Portraits", in which case we
list a:
BodyStyle (tank, delivery, milk, fire pumper, beer, tow, etc.)
Other reasons are Insurance, plant views, and truck show pics. (No BodyStyle)
I have figured out how to disable the bodystyle combo box in my form using:
Private Sub cboReason_AfterUpdate()
If Not 1 Then Me.cboBodyStyle.Enabled = False
End Sub
where 1 = portrait, AND
Private Sub Form_AfterUpdate()
Me.cboBodyStyle.Enabled = True
End Sub
to re-set the control when moving to the next entry. My first efforts at
code from scratch and these actually work - what a thrill! Also FYI - the
default for reason is portrait.
If a user changes the reason accidentally, then changes back to portrait,
the bodystyle box is still disabled. Not so good. So I added:
Private Sub txtSubjComment_GotFocus()
Dim Msg, Style
'Define message
Msg = "If you need to change the body style, hit F9"
'define style
Style = vbOKOnly
'Display message
Response = MsgBox(Msg, Style)
End Sub
SubjComment is the next field after Reason & BodyStyle.
(Even this works!) It does what I tell it, but all the time, which is very
annoying. Obviously I'm working with the wrong event, or else I need to add
another condition? Should it be something like
if cboReason_AfterUpdate = 1 then Response = MsgBox
Just tried it and that didn't work.
Should I be changing the event or adding qualifiers to
txtSubjComment_GotFocus or both??
Thanks very much
manufacturer. Have set up the following fields:
Reason (why photo was taken). Most pics are "Portraits", in which case we
list a:
BodyStyle (tank, delivery, milk, fire pumper, beer, tow, etc.)
Other reasons are Insurance, plant views, and truck show pics. (No BodyStyle)
I have figured out how to disable the bodystyle combo box in my form using:
Private Sub cboReason_AfterUpdate()
If Not 1 Then Me.cboBodyStyle.Enabled = False
End Sub
where 1 = portrait, AND
Private Sub Form_AfterUpdate()
Me.cboBodyStyle.Enabled = True
End Sub
to re-set the control when moving to the next entry. My first efforts at
code from scratch and these actually work - what a thrill! Also FYI - the
default for reason is portrait.
If a user changes the reason accidentally, then changes back to portrait,
the bodystyle box is still disabled. Not so good. So I added:
Private Sub txtSubjComment_GotFocus()
Dim Msg, Style
'Define message
Msg = "If you need to change the body style, hit F9"
'define style
Style = vbOKOnly
'Display message
Response = MsgBox(Msg, Style)
End Sub
SubjComment is the next field after Reason & BodyStyle.
(Even this works!) It does what I tell it, but all the time, which is very
annoying. Obviously I'm working with the wrong event, or else I need to add
another condition? Should it be something like
if cboReason_AfterUpdate = 1 then Response = MsgBox
Just tried it and that didn't work.
Should I be changing the event or adding qualifiers to
txtSubjComment_GotFocus or both??
Thanks very much