Error 424 'Object Required' message

G

Guest

when i try this in my a2k application the said message above arriveth:

Private Sub Frame1_BeforeUpdate(Cancel As Integer)
Dim lngRetVal As Long
ToggleColor
If Me.Dirty = True And Me.Frame1.OldValue <> 5 And Me.Frame1 = 5 And _
Me.SequenceNum Is Null Then
lngRetVal = MsgBox("You are attempting to code this Px as 'Off Study'.
Sequence Number is Required!" _
, vbOK, "Critical")
Select Case lngRetVal
Case vbOK
Me.Frame1.Value = Me.Frame1.OldValue
End Select
End If
End Sub

in more or less simple english, what i'm trying to do is to advise the user
that they should have entered a value in me.sequencenum when the above
conditions are met and to revert the options group.

can anybody tell me what i'm doing that's cause it to go awry?

-ted
 
G

Guest

It would be helpful if we knew which line the error occurred on. In any
case, there is a syntax error. It may be causing the problem. Is Null is for
SQL, what you want is the IsNull() function
Change:
Me.SequenceNum Is Null
To:
IsNull(Me.SequenceNum)
 
G

Guest

Borada nikto again :)

Yes, that does it!!!! So, i've gotten past that li'l hurdle but (now the
plot thickens), i also learned that i need to use me.Frame1.undo in order to
'undo' the user's change (otherwise an error 2115 arrives) which i have.

there must be a bit more that i need to do in order to get the button that
corresponded with the 'oldvalue' pressed though 'cause it doesn't 'look' as
though things were undone?
 
G

Guest

I meant to mention the Undo to you. Are you saying the number entered
remains displayed, not the original number?
 
G

Guest

Nupe, there are 7 buttons which make up Frame1 option group. each one effects
the value of the control i dubbed 'Outcome_'. When I use 'undo', there's no
visible effect, the button corresponding with Case 5 is still
clicked/depressed.
HTH
 
G

Guest

Give this a try, it may also clear up your 2115 problem.
Let me know how it turns out.

Private Sub Frame1_BeforeUpdate(Cancel As Integer)

ToggleColor
If Me.Dirty = True And Me.Frame1.OldValue <> 5 And Me.Frame1 = 5 And _
IsNull(Me.SequenceNum) Then
MsgBox "You are attempting to code this Px as 'Off Study'." _
& " Sequence Number is Required!", vbOK, "Critical"
Cancel = True
End If
End Sub
 
G

Guest

as my good buddy Gort said, give a man a fish and you feed him once, give him
a fishing pole and he shall eat forever (of course there are some ideas that
can get lost in translation)....so since i'm pretty sure this is gonna work
and it won't be until 'round 'bout monday when i gets to tryi it out, let me
in on the theory: what's different about -this- code?

-ted
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top