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
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
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
will
NOT
save the displayed value to a field in the form's underlying
table.
if
you
want to *save* the value from a control in one form into a
field
in
a
table
bound to another form, you'll have to use a macro or VBA to
set
the
value of
the field (or bound control) in the second form.
hth
in
message
Tina,
I think I understand the DLookup() function, but I can't
figure
out
where
to
place it to make it work properly.
My dlookup is this:
=DLookUp("[Invoiced]","[Invoice]","[JobNumber]='" &
[Forms]![Order
Entry]![Order Number] & "'")
Can you tell me if that is correct?
The fields in both tables is a checkbox. When I place it
in
an
expression
as control source for the checkbox on the Order Entry
table
the
box
just
flashes from grey to white.
If someone could give me a working example or provide some
more
detailed
help it would be most appreciated.
Thanks,
Johnie Karr
"tina" wrote: