DLookup works once

R

RMires

I am using the following to find volumes from a table when inputing a gauge
(from a storage tank) on a form:

=DLookUp("[Volume]","tblStrap2612","[Gauge]
=[Forms]![frmStrap2612]![InputGauge]")

This works...once. If I change the number in the textbox control
"InputGauge" on the form, the result stays the same. I have tried the
following:

=DLookUp("[Volume]","tblStrap2612","[Gauge] ="
&[Forms]![frmStrap2612]![InputGauge])

but then I recieve an #ERROR
 
O

Ofer

Where did you locate the Dlookup statement?
If it is in the control source of the field then
=DLookUp("[Volume]","tblStrap2612","[Gauge] = "&[InputGauge])

Unless the Gauge field type is string, then try
=DLookUp("[Volume]","tblStrap2612","[Gauge] = '" & [InputGauge] & "'")

The Me.InputGauge.Requery mean
Me = Current form
InputGauge = The name of the field in the form you refer to
Requery = Activate the Dlookup again


--
\\// Live Long and Prosper \\//
BS"D


RMires said:
=DLookUp("[Volume]","tblStrap2612","[Gauge] = [InputGauge]")

Works, but =DLookUp("[Volume]","tblStrap2612","[Gauge] = "&[InputGauge])
gives me the same error. What is the Me in the Me.InputGauge.Requery
expression? It tells me that it doesn't recognize the Macro "Me"


Ofer said:
Try

=DLookUp("[Volume]","tblStrap2612","[Gauge] = " & [InputGauge])

And you can try and refresh this field when the InputGauge changes, on the
after update event of the field, write

Me.InputGauge.Requery

--
\\// Live Long and Prosper \\//
BS"D


RMires said:
I am using the following to find volumes from a table when inputing a gauge
(from a storage tank) on a form:

=DLookUp("[Volume]","tblStrap2612","[Gauge]
=[Forms]![frmStrap2612]![InputGauge]")

This works...once. If I change the number in the textbox control
"InputGauge" on the form, the result stays the same. I have tried the
following:

=DLookUp("[Volume]","tblStrap2612","[Gauge] ="
&[Forms]![frmStrap2612]![InputGauge])

but then I recieve an #ERROR
 
O

Ofer

Try

=DLookUp("[Volume]","tblStrap2612","[Gauge] = " & [InputGauge])

And you can try and refresh this field when the InputGauge changes, on the
after update event of the field, write

Me.InputGauge.Requery
 
R

RMires

=DLookUp("[Volume]","tblStrap2612","[Gauge] = [InputGauge]")

Works, but =DLookUp("[Volume]","tblStrap2612","[Gauge] = "&[InputGauge])
gives me the same error. What is the Me in the Me.InputGauge.Requery
expression? It tells me that it doesn't recognize the Macro "Me"


Ofer said:
Try

=DLookUp("[Volume]","tblStrap2612","[Gauge] = " & [InputGauge])

And you can try and refresh this field when the InputGauge changes, on the
after update event of the field, write

Me.InputGauge.Requery

--
\\// Live Long and Prosper \\//
BS"D


RMires said:
I am using the following to find volumes from a table when inputing a gauge
(from a storage tank) on a form:

=DLookUp("[Volume]","tblStrap2612","[Gauge]
=[Forms]![frmStrap2612]![InputGauge]")

This works...once. If I change the number in the textbox control
"InputGauge" on the form, the result stays the same. I have tried the
following:

=DLookUp("[Volume]","tblStrap2612","[Gauge] ="
&[Forms]![frmStrap2612]![InputGauge])

but then I recieve an #ERROR
 
O

Ofer

Sorry, I forgot one thing

When you are on the After update event of the InputGauge field, you can see
a button on the right with three dots, click on it, and select code view, and
tere you can put the code

Me.[insert here The Field name where the dlookup is in].Requery
--
\\// Live Long and Prosper \\//
BS"D


RMires said:
=DLookUp("[Volume]","tblStrap2612","[Gauge] = [InputGauge]")

Works, but =DLookUp("[Volume]","tblStrap2612","[Gauge] = "&[InputGauge])
gives me the same error. What is the Me in the Me.InputGauge.Requery
expression? It tells me that it doesn't recognize the Macro "Me"


Ofer said:
Try

=DLookUp("[Volume]","tblStrap2612","[Gauge] = " & [InputGauge])

And you can try and refresh this field when the InputGauge changes, on the
after update event of the field, write

Me.InputGauge.Requery

--
\\// Live Long and Prosper \\//
BS"D


RMires said:
I am using the following to find volumes from a table when inputing a gauge
(from a storage tank) on a form:

=DLookUp("[Volume]","tblStrap2612","[Gauge]
=[Forms]![frmStrap2612]![InputGauge]")

This works...once. If I change the number in the textbox control
"InputGauge" on the form, the result stays the same. I have tried the
following:

=DLookUp("[Volume]","tblStrap2612","[Gauge] ="
&[Forms]![frmStrap2612]![InputGauge])

but then I recieve an #ERROR
 

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

Similar Threads


Top