IsNull runTime: Invalid Use of Null | | |
I am trying to identify if a information in a details field
(damagedetails; soildetails) has NOT been entered if the presence of
damage or soil has been determined (check boxes: chkDamage and
chkSoil).
Here is my code on the Close Event of the form (don't know if there's a
better place to put it?)
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
Dim chkDamage As String
Dim chkSoil As String
Dim txtDamageDetails As String
Dim txtSoilDetails As String
chkDamage = Me.chkDamage
chkSoil = Me.chkSoil
txtDamageDetails = Me.txtDamageDetails
txtSoilDetails = Me.txtSoilDetails
MsgBox Me.txtDamageDetails & " soil det " & Me.txtSoilDetails
' If anything has changed, make sure that there are details for soil
or damage,
' if either is true
If Me.Dirty = True Then
If chkDamage = True Then
If Len(Trim$(Me.txtDamageDetails & vbNullString)) = 0 Then
' Same erorr with this code:
' If IsNull(txtDamageDetails) Then
MsgBox "Please enter Damage Details"
End If
End If
If chkSoil = True Then
If Len(Trim$(Me.txtSoilDetails & vbNullString)) = 0 Then
MsgBox "Please enter Soil Details"
End If
End If
End If
DoCmd.Close
Thanks. 90 minutes on this; can't find posts or Help to clear it up.
sara | | | | re: IsNull runTime: Invalid Use of Null
You're assigning the value of the text boxes to String variables.
If no value has been assigned (i.e.: if the text boxes contain Null), that's
the cause of your problem: string variables cannot hold Null values. The
only variable type that can hold Null is the variant.
--
Doug Steele, Microsoft Access MVP http://I.Am/DougSteele
(no e-mails, please!)
"sara" <saraqpost@yahoo.com> wrote in message
news:1128971218.702750.161740@g49g2000cwa.googlegr oups.com...[color=blue]
>I am trying to identify if a information in a details field
> (damagedetails; soildetails) has NOT been entered if the presence of
> damage or soil has been determined (check boxes: chkDamage and
> chkSoil).
>
> Here is my code on the Close Event of the form (don't know if there's a
> better place to put it?)
>
> Private Sub cmdClose_Click()
> On Error GoTo Err_cmdClose_Click
>
> Dim chkDamage As String
> Dim chkSoil As String
> Dim txtDamageDetails As String
> Dim txtSoilDetails As String
>
> chkDamage = Me.chkDamage
> chkSoil = Me.chkSoil
> txtDamageDetails = Me.txtDamageDetails
> txtSoilDetails = Me.txtSoilDetails
>
> MsgBox Me.txtDamageDetails & " soil det " & Me.txtSoilDetails
> ' If anything has changed, make sure that there are details for soil
> or damage,
> ' if either is true
>
> If Me.Dirty = True Then
>
> If chkDamage = True Then
> If Len(Trim$(Me.txtDamageDetails & vbNullString)) = 0 Then
> ' Same erorr with this code:
> ' If IsNull(txtDamageDetails) Then
> MsgBox "Please enter Damage Details"
> End If
> End If
>
> If chkSoil = True Then
> If Len(Trim$(Me.txtSoilDetails & vbNullString)) = 0 Then
> MsgBox "Please enter Soil Details"
> End If
> End If
> End If
>
> DoCmd.Close
>
> Thanks. 90 minutes on this; can't find posts or Help to clear it up.
>
> sara
>[/color] | | | | re: IsNull runTime: Invalid Use of Null
So should I change the Dimension to variant or change the code to
If len(txtDamageDetails) = 0 then....
? ?
Will either or both work?
Thanks. | | | | re: IsNull runTime: Invalid Use of Null
Dimension to variant, or use If Len(txtDamageDetails & "") = 0 then
--
Doug Steele, Microsoft Access MVP http://I.Am/DougSteele
(no e-mails, please!)
"sara" <saraqpost@yahoo.com> wrote in message
news:1128977416.801929.158070@z14g2000cwz.googlegr oups.com...[color=blue]
> So should I change the Dimension to variant or change the code to
> If len(txtDamageDetails) = 0 then....
>
> ? ?
>
> Will either or both work?
>
> Thanks.
>[/color] | | | | re: IsNull runTime: Invalid Use of Null
I'd think there are better events than Close for your test. Very likely, if
you tested in BeforeUpdate, you could Cancel the update and inform the user
that particular fields must be entered. What, specifically, are you asking
here? What do you want to accomplish, and what exactly are you experiencing
that is different?
Larry Linson
Microsoft Access MVP
"sara" <saraqpost@yahoo.com> wrote in message
news:1128971218.702750.161740@g49g2000cwa.googlegr oups.com...[color=blue]
>I am trying to identify if a information in a details field
> (damagedetails; soildetails) has NOT been entered if the presence of
> damage or soil has been determined (check boxes: chkDamage and
> chkSoil).
>
> Here is my code on the Close Event of the form (don't know if there's a
> better place to put it?)
>
> Private Sub cmdClose_Click()
> On Error GoTo Err_cmdClose_Click
>
> Dim chkDamage As String
> Dim chkSoil As String
> Dim txtDamageDetails As String
> Dim txtSoilDetails As String
>
> chkDamage = Me.chkDamage
> chkSoil = Me.chkSoil
> txtDamageDetails = Me.txtDamageDetails
> txtSoilDetails = Me.txtSoilDetails
>
> MsgBox Me.txtDamageDetails & " soil det " & Me.txtSoilDetails
> ' If anything has changed, make sure that there are details for soil
> or damage,
> ' if either is true
>
> If Me.Dirty = True Then
>
> If chkDamage = True Then
> If Len(Trim$(Me.txtDamageDetails & vbNullString)) = 0 Then
> ' Same erorr with this code:
> ' If IsNull(txtDamageDetails) Then
> MsgBox "Please enter Damage Details"
> End If
> End If
>
> If chkSoil = True Then
> If Len(Trim$(Me.txtSoilDetails & vbNullString)) = 0 Then
> MsgBox "Please enter Soil Details"
> End If
> End If
> End If
>
> DoCmd.Close
>
> Thanks. 90 minutes on this; can't find posts or Help to clear it up.
>
> sara
>[/color] | | | | re: IsNull runTime: Invalid Use of Null
I've put comments inline.
"sara" <saraqpost@yahoo.com> wrote in
news:1128971218.702750.161740@g49g2000cwa.googlegr oups.com:
[color=blue]
> I am trying to identify if a information in a details field
> (damagedetails; soildetails) has NOT been entered if the
> presence of damage or soil has been determined (check boxes:
> chkDamage and chkSoil).
>
> Here is my code on the Close Event of the form (don't know if
> there's a better place to put it?)
>[/color]
Bad place. The form's before_update Event is where it needs to
go.
[color=blue]
> Private Sub cmdClose_Click()
> On Error GoTo Err_cmdClose_Click[/color]
Change to Sub Before_Update(cancel)[color=blue]
>
> Dim chkDamage As String
> Dim chkSoil As String[/color]
Why are you Dimming boolean values as string?
Why bother to Dim variable at all when you have the controls to
work with?
[color=blue]
> Dim txtDamageDetails As String
> Dim txtSoilDetails As String
>
> chkDamage = Me.chkDamage
> chkSoil = Me.chkSoil
> txtDamageDetails = Me.txtDamageDetails
> txtSoilDetails = Me.txtSoilDetails
>
> MsgBox Me.txtDamageDetails & " soil det " &
> Me.txtSoilDetails
> ' If anything has changed, make sure that there are details
> for soil or damage,
> ' if either is true
>
> If Me.Dirty = True Then
>
> If chkDamage = True Then
> If Len(Trim$(Me.txtDamageDetails & vbNullString))
> = 0 Then[/color]
What is VbNullString? It's not needed.
If len(trim(Me.txtDamageDetails)) = 0 Then
And you can combine the two tests:
If Me.ChkDamage AND len(trim(Me.txtDamageDetails))=0.Then
Cancel = true
Msgbox "whatever"
end if
[color=blue]
> ' Same erorr with this code:
> ' If IsNull(txtDamageDetails) Then
> MsgBox "Please enter Damage Details"
> End If
> End If
>
> If chkSoil = True Then
> If Len(Trim$(Me.txtSoilDetails & vbNullString)) =
> 0 Then
> MsgBox "Please enter Soil Details"
> End If
> End If
> End If
>
> DoCmd.Close
>
> Thanks. 90 minutes on this; can't find posts or Help to clear
> it up.
>
> sara
>[/color]
--
Bob Quintal
PA is y I've altered my email address. | | | | re: IsNull runTime: Invalid Use of Null
Ok, Secret's out. I'm new!
I thought of After_Update, but now am thinking about Before Update.
The requirement is that if the user says the garment coming in (for
storage, say), is soiled or damaged, that information must be entered
in detail - in case the customer tries to accuse the company of
damaging/soiling their garment while it was in storage.
SO, if the user clicks on the "Damage" check box, I want to prevent her
from going to the next task until she records the details of the damage
(same for soil). I will move the code, with checking for len(0)
[thanks, Doug] to Before_Update. and test it.
Many thanks. | | | | re: IsNull runTime: Invalid Use of Null
Thanks, Bob, for the info.
1. I put that boolean code in, etc, as my code wasn't working, so I
did a search on this site and found that code and thought it would
accomplish my objective, so I used it.
Not sure what Cancel=true means. I understand that I should move the
code to the Before_Update event (I'm new to forms coding and very new
to Events), but thought I could just say If, then, MsgBox.
I'm guessing that Cancel=true means Cancel the update - that's what the
Before-Update event is "expecting"? That is why you say
"Before_Update(cancel)" - Cancel is what I want Access to do if I meet
the criteria?
I put the code in and tested it and the form closes, and the record
updates if the checkbox is checked and the details is blank. Clearly
something is wrong on my end. I took out If Me.Dirty, as I figure that
Access knows it's Dirty if it's firing the Before_Update event.
I had the variables Dim and assigned values in and out.
Still allowing me to say "soiled" (by checking the box) and leave the
details blank:
Private Sub Before_Update(cancel)
On Error GoTo Err_Before_Update
Dim chkDamage As String
Dim chkSoil As String
Dim txtDamageDetails As String
Dim txtSoilDetails As String
chkDamage = Me.chkDamage
chkSoil = Me.chkSoil
txtDamageDetails = Me.txtDamageDetails
txtSoilDetails = Me.txtSoilDetails
' If anything has changed, make sure that there are details for soil
or damage,
' if either is true
' If Me.Dirty = True Then
If chkDamage And Len(Trim(txtDamageDetails)) = 0# Then
cancel = True
MsgBox "Please enter Damage Details"
End If
If chkSoil And Len(Trim(txtSoilDetails)) = 0# Then
cancel = True
MsgBox "Please enter Soil Details"
End If
' End If
Thoughts? Help?
thanks | | | | re: IsNull runTime: Invalid Use of Null
Ok, let's try some debugging.
Let's add some code just before the section
If chkDamage And Len(Trim(txtDamageDetails)) = 0# Then
MSGBOX "chkdamage is: " & chkdamage
MSGBOX "Len(trim((txtSoilDetails)) is :" & Len(trim((txtSoilDetails))
and we shall see what is happening.
Bob Q | | | | re: IsNull runTime: Invalid Use of Null
Now I'm seeing something - NOTHING!
The Before_Update event isn't even firing - these message boxes never
displayed. (Code below and it does compile)
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Form_Before_Update
Dim chkDamage As CheckBox
Dim chkSoil As CheckBox
Dim txtDamageDetails As String
Dim txtSoilDetails As String
chkDamage = Me.chkDamage
chkSoil = Me.chkSoil
txtDamageDetails = Me.txtDamageDetails
txtSoilDetails = Me.txtSoilDetails
MsgBox "chkdamage is: " & chkDamage
MsgBox "Len trim txtSoilDetails is :" & Len(Trim(txtSoilDetails))
If chkDamage And Len(Trim(txtDamageDetails)) = 0# Then
Cancel = True
MsgBox "Please enter Damage Details"
End If
If chkSoil And Len(Trim(txtSoilDetails)) = 0# Then
Cancel = True
MsgBox "Please enter Soil Details"
End If
Clueless!
thanks -
Sara | | | | re: IsNull runTime: Invalid Use of Null
"sara" <saraqpost@yahoo.com> wrote in
news:1129054605.488107.318270@f14g2000cwb.googlegr oups.com:
[color=blue]
> Now I'm seeing something - NOTHING!
> The Before_Update event isn't even firing - these message
> boxes never displayed. (Code below and it does compile)
>[/color]
Check that the event property in the form is set to 'Event
Procedure'. If it's blank or has the name of a macro or function
it may be the problem.
Also if Err_Form_Before_Update contains a resume next statement,
that may be the problem.
[color=blue]
> Private Sub Form_BeforeUpdate(Cancel As Integer)
> On Error GoTo Err_Form_Before_Update
>
> Dim chkDamage As CheckBox
> Dim chkSoil As CheckBox
>
> Dim txtDamageDetails As String
> Dim txtSoilDetails As String
>
> chkDamage = Me.chkDamage
> chkSoil = Me.chkSoil
> txtDamageDetails = Me.txtDamageDetails
> txtSoilDetails = Me.txtSoilDetails
>
> MsgBox "chkdamage is: " & chkDamage
> MsgBox "Len trim txtSoilDetails is :" &
> Len(Trim(txtSoilDetails))
>
>
>
> If chkDamage And Len(Trim(txtDamageDetails)) = 0# Then
> Cancel = True
> MsgBox "Please enter Damage Details"
> End If
>
> If chkSoil And Len(Trim(txtSoilDetails)) = 0# Then
> Cancel = True
> MsgBox "Please enter Soil Details"
> End If
>
> Clueless!
> thanks -
> Sara
>
>[/color]
--
Bob Quintal
PA is y I've altered my email address. | | | | re: IsNull runTime: Invalid Use of Null
Neither of those things is true, so here's what I did and learned:
I put a msgbox in the error procedure - "error" - in the before_update
event.
When I click the Close button, I get the error IF I've made ANY changes
to the item.
Could it be something with the query on which the form is based? I'm
still not clear on why Before_Update isn't working, but it doesn't seem
to like the txtDetailComments (or Soil) fields at all.
I can update these fields directly in the query results.
I am stumped!
Sara | | | | re: IsNull runTime: Invalid Use of Null
"sara" <saraqpost@yahoo.com> wrote in
news:1129074666.204805.320180@g49g2000cwa.googlegr oups.com:
[color=blue]
> Neither of those things is true, so here's what I did and
> learned:
>
> I put a msgbox in the error procedure - "error" - in the
> before_update event.
>
> When I click the Close button, I get the error IF I've made
> ANY changes to the item.
>
> Could it be something with the query on which the form is
> based? I'm still not clear on why Before_Update isn't
> working, but it doesn't seem to like the txtDetailComments (or
> Soil) fields at all.
>
> I can update these fields directly in the query results.
>
> I am stumped!
> Sara
>[/color]
Well, your error handler in the before update event firing tells
you that something is wrong in that sub-procedure. Possibly it's
some code that you have not posted about. Comment out the 'On
Error' call, see what error numbers come up.
As to the query, since it works in hte query, that is fine. One
issue: if you have variable names identical to control names,
that is the name of a textbox, Access WILL get confused about
which you intend.
--
Bob Quintal
PA is y I've altered my email address. | | | | re: IsNull runTime: Invalid Use of Null
OK. I've tested according to your instructions and here's what's
happening.
This is with the variables declared as CheckBox.
1. Error 91: Object Variable or With Block Variable not set. (This
is when I click "Close" on my form, but the code stops in the
Before_Update Event Procedure.
2. The line of code is: chkDamage = Me.chkDamage
The error occurs whether CheckDamage is on with details or not, WHEN I
am updating ChkSoil.
It occurs when I try to close the form after editing a record that has
chkDamage ON, but no details.
The error occurs when I go to close the form if I've made ANY changes
to the item - even another field and left chkDamage and chkSoil blank.
This is with the variable (chkDamage and chkSoil) declared as String:
1. Further in the code, it fails on txtDamageDetails =
Me.txtDamageDetails with RunTime Error 94 - Invalid Use of Null.
2. This happens whether I Dimension the variable as txtDamageDetails
or DamageDetails. It doesn't matter what field I change.
Private Sub Form_BeforeUpdate(Cancel As Integer)
' On Error GoTo Err_Form_Before_Update
Dim chkDamage As String
Dim chkSoil As String
Dim DamageDetails As String
Dim SoilDetails As String
chkDamage = Me.chkDamage
chkSoil = Me.chkSoil
MsgBox "before Damage text set"
DamageDetails = Me.txtDamageDetails
SoilDetails = Me.txtSoilDetails
I see my message box (when the variables are STRING) "before Damage
text set", and the code breaks on the next line.
Back to the original problem - Invalid use of null. Any ideas on next
steps?
thanks
Sara | | | | re: IsNull runTime: Invalid Use of Null
Sara:
Access won't let you set a string to Null, so you have to handle that
situation. An easy way to accomplish this is to use the Nz function,
which will convert a Null value into something else. Change the
following 2 lines and all should be good!
txtDamageDetails = Nz(Me.txtDamageDetails, "")
txtSoilDetails = Nz(Me.txtSoilDetails, "")
What this does is looks at the value of txtDamageDetails and, if the
value is Null, it sets it to an empty string instead.
On another note, when this works right, the user gets 2 messages right
in a row if both damage and soil are checked. You may want to add a
line that takes the user to the applicable details field so it's clear
what you're needing from them and then stops. Once they correct the
first issue, the BeforeUpdate event will happen again and will give
them another message if they're still missing something you need.
Here's what I would do:
If chkDamage And Len(Trim(txtDamageDetails)) = 0# Then
Cancel = True
MsgBox "Please enter Damage Details"
DoCmd.GoToControl "txtDamageDetails"
Exit Sub
End If
If chkSoil And Len(Trim(txtSoilDetails)) = 0# Then
Cancel = True
MsgBox "Please enter Soil Details"
DoCmd.GoToControl "txtSoilDetails"
Exit Sub
End If
Hope this helps!
Jana | | | | re: IsNull runTime: Invalid Use of Null
"sara" <saraqpost@yahoo.com> wrote in
news:1129211651.709474.18260@g49g2000cwa.googlegro ups.com:
[color=blue]
> OK. I've tested according to your instructions and here's
> what's happening.
>
> This is with the variables declared as CheckBox.
> 1. Error 91: Object Variable or With Block Variable not set.
> (This is when I click "Close" on my form, but the code stops
> in the Before_Update Event Procedure.
>
> 2. The line of code is: chkDamage = Me.chkDamage
> The error occurs whether CheckDamage is on with details or
> not, WHEN I am updating ChkSoil.
> It occurs when I try to close the form after editing a record
> that has chkDamage ON, but no details.
> The error occurs when I go to close the form if I've made ANY
> changes to the item - even another field and left chkDamage
> and chkSoil blank.
>
> This is with the variable (chkDamage and chkSoil) declared as
> String: 1. Further in the code, it fails on txtDamageDetails
> = Me.txtDamageDetails with RunTime Error 94 - Invalid Use of
> Null. 2. This happens whether I Dimension the variable as
> txtDamageDetails or DamageDetails. It doesn't matter what
> field I change.
>
> Private Sub Form_BeforeUpdate(Cancel As Integer)
> ' On Error GoTo Err_Form_Before_Update
>
> Dim chkDamage As String
> Dim chkSoil As String
>
> Dim DamageDetails As String
> Dim SoilDetails As String
>
> chkDamage = Me.chkDamage
> chkSoil = Me.chkSoil
>
> MsgBox "before Damage text set"
> DamageDetails = Me.txtDamageDetails
> SoilDetails = Me.txtSoilDetails
>
> I see my message box (when the variables are STRING) "before
> Damage text set", and the code breaks on the next line.
>
> Back to the original problem - Invalid use of null. Any ideas
> on next steps?
>[/color]
Yes! delete the 9 lines of code shown above from your procedure.
There is absolutely no need for them
See the response that Jana has made to this post.
Modify the remainder of the code to use the me.... data
directly.
Then the rest of your code should work
--
Bob Quintal
PA is y I've altered my email address. | | | | re: IsNull runTime: Invalid Use of Null
Almost there, Jana & Bob! It's heartening to be able to have your
continued support.
I've changed the code (see below), but have a new problem I can't
figure out.
IF the box is checked, but there is no supporting detail, I DO get the
message (when I click on the "Close" Button), but then the form closes.
It doesn't STOP, go to the form, allow me to input the forgotten
details, and run the check again.
SO, after some research, I tried the code at the bottom - Do
While...Loop. HELP wasn't very helpFUL, but I do have a loop that runs
- endlessly.
Now I get the message "Please enter Damage Details" in an endless loop
- no way to interrupt it to put in those details.
How can I fix that?
CODE:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Form_Before_Update
Dim chkDamage As String
Dim chkSoil As String
Dim DamageDetails As String
Dim SoilDetails As String
chkDamage = Me.chkDamage
chkSoil = Me.chkSoil
txtDamageDetails = Nz(Me.txtDamageDetails, "")
txtSoilDetails = Nz(Me.txtSoilDetails, "")
' If anything has changed, make sure that there are details for soil
or damage,
' if either is true
If chkDamage And Len(Trim(txtDamageDetails)) = 0# Then
Cancel = True
MsgBox "Please enter Damage Details"
DoCmd.GoToControl "txtDamageDetails"
Exit Sub
End If
If chkSoil And Len(Trim(txtSoilDetails)) = 0# Then
Cancel = True
MsgBox "Please enter Soil Details"
DoCmd.GoToControl "txtSoilDetails"
Exit Sub
End If
Exit_Form_Before_Update:
Exit Sub
Err_Form_Before_Update:
MsgBox Err.Number & " " & Err.Description
Resume Exit_Form_Before_Update
End Sub
LOOP:
' *** Note: Damage is an endless loop; Soil form just closes
If chkDamage And Len(Trim(txtDamageDetails)) = 0# Then
Do While Len(Trim(txtDamageDetails)) = 0#
Cancel = True
MsgBox "Please enter Damage Details"
DoCmd.GoToControl "txtDamageDetails"
Loop
Exit Sub
End If
If chkSoil And Len(Trim(txtSoilDetails)) = 0# Then
Cancel = True
MsgBox "Please enter Soil Details"
DoCmd.GoToControl "txtSoilDetails"
Exit Sub
End If | | | | re: IsNull runTime: Invalid Use of Null
Sara:
When you say that it closes when you click on the 'Close' button, do
you mean the X at the top of the window, or do you have a custom
command button to close the form? When I click the X, Access tells me
that I'm missing the details, then it immediately tells me that it
can't save the record at this time and asks me if I still want to
close. If I click yes, it discards the record and closes. If I click
no, it brings me back to the appropriate details field. I think the
only way this would NOT warn me that it can't save the record is if
warnings have been turned off with code sometime during the running of
your database with a line that says 'DoCmd.SetWarnings False' without
turning them back on again with a 'DoCmd.SetWarnings True' line.
If, however, I have a Command Button to close the form, it does as
you've described and discards the changes without so much as a warning,
so I'm going to assume that's what is happening. There are probably
many different ways to stop this from happening, but here's one method:
Go into your form module and at the top of the window, under the line
(or lines) that start with the word 'Option', you're going to declare a
variable.
Dim StopMe as Boolean
In your code for the BeforeUpdate event, add the following before each
of the Exit Sub lines in the IF statements:
StopMe = True
Now find the code for your 'close' command button and look for a line
that says 'DoCmd.Close' and replace it with the following:
Form_BeforeUpdate (False)
If StopMe = True Then
Exit Sub
Else
DoCmd.Close
End If
Save everything and give it a shot. I believe this will do what you're
looking for.
Here's what we're doing~
Declaring our StopMe variable at the top of the module declares a
global variable that can be set and accessed by other code within the
SAME module, but in different Subs. So we can have one sub set the
value of the variable, and have another sub look at that variable for
guidance.
Adding the lines to the close command button basically forces the
Form_BeforeUpdate Event to occur. We have to feed that sub a value for
Cancel, so we're telling it to not cancel by using (False) after the
call to the update event. Since we're forcing the BeforeUpdate event,
we're also resetting the StopMe variable. Once the StopMe is set, then
the close button can look to see if the user should be stopped. If the
answer is yes, then the button does nothing. If the answer is no, then
it goes ahead and closes the form.
Hope this isn't too confusing!
Jana | | | | re: IsNull runTime: Invalid Use of Null
Amazing! Yes, I understand this - your explanation was excellent.
The only thing I had to do was add the line "StopMe = False" at the
top, after setting all the other variables. Without it, I could add
details (yes, there is a CLOSE button that I wrote), press the close
button, and nothing would happen. I looked over the code and figured
that StopMe was still true - nothing was setting it to false. So even
though the details was not empty, the form wasn't closing.
SO, I added the StopMe=False before all the IF statements. It seems to
work now.
Did I do the right thing? In the right place?
Again, thanks for jumping in and helping here. I so very much
appreciate what you and Bob have done for me. Onto my next challenge!
Sara | | | | re: IsNull runTime: Invalid Use of Null
Sara:
Yay!!! It sounds like you did the right things :D I am so glad that
this worked for you. And, you're right, I forgot to tell you to reset
StopMe to False -- good catch on your part!!! That tells me you
REALLY understood my explanation & weren't just faking it :-)
Good job, and have fun coding,
Jana |  | Similar Microsoft Access / VBA bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,467 network members.
|