J
Johnie Karr
Tina,
It's on the way. I'm requesting a read-reciept just to make sure I got the
e-mail correct.
Thanks,
Johnie Karr
It's on the way. I'm requesting a read-reciept just to make sure I got the
e-mail correct.
Thanks,
Johnie Karr
tina said:well, there's no reason i can think of that it wouldn't work as outlined. if
you're using Access97 or newer, i'll take a look at your db and
troubleshoot, if you want to email it to me. to do that: copy the db and
delete any proprietary data from the copy, enter dummy records if necessary
so i'll have something to work with. compact the copy, and zip it if you can
(i have dialup, so slow downloading). refer to this newsgorup in the email
subject line, so it doesn't get deleted as spam, and refer to this thread in
the message text so i can find it to post back. my email address is at
http://home.att.net/~california.db/tips.html#aTip11, just follow the
instructions in the Example and also change the 2 to a 1.
hth
Johnie Karr said:Tina,
No, it isn't working. I've updated my control source with your code
(currect syntax) and have this in my VBA:
Private Sub Form_Current()
Me!Invoiced.Requery
End Sub
Me!Invoiced is the name of my checkbox. I know in one post I said it was
isInvoiced, but I changed it.
This is the code that gives me the error I displayed earlier.
Any thoughts?
Thanks,
Johnie Karr
tina said:okay. so is it working for you, or not working?
Tina,
The method demonstrated in the pdf file you told me about is how I created
the event procedure for the on current.
Thanks,
Johnie Karr
:
comments inline.
I'm using the code that Douglas Steel posted in my checkbox's
ControlSource.
i told you how to check to data type of JobNumber, and you posted back
that
you verified it as Text data type. Doug's post asked you if the field is
Number data type, and gave you code to fit that data type. if it IS
number
data type, that's fine - but you need to check your table and see what
the
field's data type actually is, once and for all, and use the correct
syntax
for that data type.
Then I use the requery line that Tina provided in my form's on_current
and
I
get this error:
The Expression On Current You Entered as the event property setting
produced
the following error: Object or class does not support the set of
events.
*The expression may not result in the name of a macro, the name of a
user-defined function, or [event procedure].
*There may have been an error evaluating the function, event, or
macro.
looks like you've put the code in the Current event "line" in the
Properties
box in the form's design view. you have to put the code in the Current
event
*procedure*, as i said before. if you don't know how to create an event
procedure in a form, go to
http://home.att.net/~california.db/instructions.html and click the
CreateEventProcedure link, then follow the illustrated instructions.
hth
Thanks,
Johnie Karr
:
you have a checkbox control on the form. set the control's
ControlSource
property to
=DLookUp("[Invoiced]","[Invoice]","[JobNumber]='" & [Forms]![Order
Entry]![Order Number] & "'")
the above goes all on one line, of course.
in the form's Current event procedure, add a line of code to requery
the
checkbox control, as
Me!CheckboxControlName.Requery
change CheckboxControlName to the correct name of the checkbox
control,
of
course.
hth
message
I did an expression for the forms on current event:
Me!isInvoiced=DLookUp("[Invoiced]","[Invoice]","[JobNumber]='" &
Forms![Order Entry]![Order Number] & "'")
and all I get is an error. Of course it's all one line in the
code
thing.
I also tried this in the vba code section, but still just keep
getting
an
error.
Thanks,
:
okay. in that case, the syntax you originally posted for the
DLookUp()
function was correct, as
=DLookUp("[Invoiced]","[Invoice]","[JobNumber]='" &
[Forms]![Order
Entry]![Order Number] & "'")
....and, well, duh, sometimes i get to things the long way
around.
since
this
is a DLookUp() function, it will run when the form opens - and
not
again,
unless you requery the checkbox control to force it to run. so
you'll
need
to add code to the form's Current event to requery the checkbox
control.
hth
message
Order Number and JobNumber are both text.
The Order Number in the Order Entry table is the reference for
the
JobNumber
in the Invoice Table.
The Invoiced checkbox in the Invoice table is Yes/No.
Thanks,
Johnie Karr
:
reading back over the thread, perhaps we've been talking at
cross-purposes.
the field that is bound to the Invoiced checkbox control, on
the
first
form,
has a Yes/No data type, correct? what are the data types of
the
Order
Number
and JobNumber fields, respectively? to see what a field's
data
type
is,
you
have to go to the *table* the contains the field, open the
table
in
design
view, and look at the field's data type there.
hth
in
message
Tina,
Thank you for the suggestion, but it still does not work.
All I'm showing is a greyed out checkbox.
I placed your code in the control source for the checkbox
named
Invoiced
on
the Order Entry form.
Also, it does not need to save it to the table as long as
it
can
pull
it's
information from the invoice table because the order entry
dept
just
needs
to
know if it's been invoiced if a customer calls.
Thanks,
Johnie Karr
:
the JobNumber field and the Order Number field are
*checkboxes*?
that
implies that the fields are Yes/No data type. is that
correct?
if
so,
then
your syntax is slightly off, since it treats JobNumber
as a
string
(Text
data type) value. try
=DLookUp("[Invoiced]","[Invoice]","[JobNumber]=" &
[Forms]![Order
Entry]![Order Number])
also note that placing the above expression in a
control's
ControlSource
property will allow the control to *display* the value -
but
it