Dlookup error

A

Amour

Hi, and thank you for any help.

I put this section into the load event on a form:

Private Sub Form_Load()
ACT_TRVL = DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")
End Sub

ACT_TRVL is connected to TblAttendance

The problem I am having is that I get an error message (but it still works
ok):

"Object doesn't support this property or method"

How do I get rid of the message or correct this. Also I have noticed that
the field does not show up until I close the form and reopen. Also does this
for some control options within the same form

Please Help And again Thank You
 
O

Ofer Cohen

I assume that ACT_TRVL is a text box name in the form, if that the case write
in the control source of that text box

= DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")

Don't store in another table a calculated resault from a query, you can
always get it using that query.
 
A

Amour

Thank you for your reply. The problem that I have with this program is that
it was developed to have the user input (manualy) the calculated resault from
excell. So now I come along and attach a form (query) that is for
calculating/displaying dates on that same form/field (ACT_TRVL), remember now
that there is other reports attached to that field(ACT_TRVL). So it looks
like there is no other way. That is why I need to store that field (I know
it is not a good programming way but for know). So I still need to fix this
problem it has to go to ACT_TRVL

Please help and thank you!

Ofer Cohen said:
I assume that ACT_TRVL is a text box name in the form, if that the case write
in the control source of that text box

= DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")

Don't store in another table a calculated resault from a query, you can
always get it using that query.

--
Good Luck
BS"D


Amour said:
Hi, and thank you for any help.

I put this section into the load event on a form:

Private Sub Form_Load()
ACT_TRVL = DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")
End Sub

ACT_TRVL is connected to TblAttendance

The problem I am having is that I get an error message (but it still works
ok):

"Object doesn't support this property or method"

How do I get rid of the message or correct this. Also I have noticed that
the field does not show up until I close the form and reopen. Also does this
for some control options within the same form

Please Help And again Thank You
 
O

Ofer Cohen

First add the Nz function to it, so the Null wil be converted into 0

Me.ACT_TRVL = Nz(DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] &
"'"),0)

Second, to try if the problem is with the Dlookup or assigning a value to
ACT_TRVL
Try

Me.ACT_TRVL = 0

See what happen, the problem might be assigning a value to ACT_TRVL

Also, check if the text box name is ACT_TRVL

--
Good Luck
BS"D


Amour said:
Thank you for your reply. The problem that I have with this program is that
it was developed to have the user input (manualy) the calculated resault from
excell. So now I come along and attach a form (query) that is for
calculating/displaying dates on that same form/field (ACT_TRVL), remember now
that there is other reports attached to that field(ACT_TRVL). So it looks
like there is no other way. That is why I need to store that field (I know
it is not a good programming way but for know). So I still need to fix this
problem it has to go to ACT_TRVL

Please help and thank you!

Ofer Cohen said:
I assume that ACT_TRVL is a text box name in the form, if that the case write
in the control source of that text box

= DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")

Don't store in another table a calculated resault from a query, you can
always get it using that query.

--
Good Luck
BS"D


Amour said:
Hi, and thank you for any help.

I put this section into the load event on a form:

Private Sub Form_Load()
ACT_TRVL = DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")
End Sub

ACT_TRVL is connected to TblAttendance

The problem I am having is that I get an error message (but it still works
ok):

"Object doesn't support this property or method"

How do I get rid of the message or correct this. Also I have noticed that
the field does not show up until I close the form and reopen. Also does this
for some control options within the same form

Please Help And again Thank You
 
A

Amour

Hi and thank you for your response. When I tried this:
Me.ACT_TRVL = Nz(DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] &
"'"), 0)

I got the same message:

"Object doesn't support this property or method" When I close the
frmAttendance form.

So I took the expression out and put it in the close section of the
frmTravel to send it to the field (ACT_TRVL) within frmAttendance:

Me.ACT_TRVL = Nz(Forms!frmTravel!GTotal)

But I got a debug message on this:

Method or data member not found

So I tried:

Forms!frmAttendanceMeeting!ACT_TRVL = Nz(Forms!frmTravel!GTotal)

Back to the same message:

"Object doesn't support this property or method" When I close the
frmAttendance form

I am opening frmAttendanceMeeting from another form, then I am opening
frmTravel from frmAttendanceMeeting. When I close frmTravel do I need to
reopen frmAttendanceMeeting some how?

Please Help and thank you!



Ofer Cohen said:
First add the Nz function to it, so the Null wil be converted into 0

Me.ACT_TRVL = Nz(DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] &
"'"),0)

Second, to try if the problem is with the Dlookup or assigning a value to
ACT_TRVL
Try

Me.ACT_TRVL = 0

See what happen, the problem might be assigning a value to ACT_TRVL

Also, check if the text box name is ACT_TRVL

--
Good Luck
BS"D


Amour said:
Thank you for your reply. The problem that I have with this program is that
it was developed to have the user input (manualy) the calculated resault from
excell. So now I come along and attach a form (query) that is for
calculating/displaying dates on that same form/field (ACT_TRVL), remember now
that there is other reports attached to that field(ACT_TRVL). So it looks
like there is no other way. That is why I need to store that field (I know
it is not a good programming way but for know). So I still need to fix this
problem it has to go to ACT_TRVL

Please help and thank you!

Ofer Cohen said:
I assume that ACT_TRVL is a text box name in the form, if that the case write
in the control source of that text box

= DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")

Don't store in another table a calculated resault from a query, you can
always get it using that query.

--
Good Luck
BS"D


:

Hi, and thank you for any help.

I put this section into the load event on a form:

Private Sub Form_Load()
ACT_TRVL = DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")
End Sub

ACT_TRVL is connected to TblAttendance

The problem I am having is that I get an error message (but it still works
ok):

"Object doesn't support this property or method"

How do I get rid of the message or correct this. Also I have noticed that
the field does not show up until I close the form and reopen. Also does this
for some control options within the same form

Please Help And again Thank You
 
A

Amour

I checked to see if assigning a value was the problem so I put:

Me.ACT_TRVL = 0

and yes that did send the same message.

So what could it be?

Thank you for any help...

Ofer Cohen said:
First add the Nz function to it, so the Null wil be converted into 0

Me.ACT_TRVL = Nz(DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] &
"'"),0)

Second, to try if the problem is with the Dlookup or assigning a value to
ACT_TRVL
Try

Me.ACT_TRVL = 0

See what happen, the problem might be assigning a value to ACT_TRVL

Also, check if the text box name is ACT_TRVL

--
Good Luck
BS"D


Amour said:
Thank you for your reply. The problem that I have with this program is that
it was developed to have the user input (manualy) the calculated resault from
excell. So now I come along and attach a form (query) that is for
calculating/displaying dates on that same form/field (ACT_TRVL), remember now
that there is other reports attached to that field(ACT_TRVL). So it looks
like there is no other way. That is why I need to store that field (I know
it is not a good programming way but for know). So I still need to fix this
problem it has to go to ACT_TRVL

Please help and thank you!

Ofer Cohen said:
I assume that ACT_TRVL is a text box name in the form, if that the case write
in the control source of that text box

= DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")

Don't store in another table a calculated resault from a query, you can
always get it using that query.

--
Good Luck
BS"D


:

Hi, and thank you for any help.

I put this section into the load event on a form:

Private Sub Form_Load()
ACT_TRVL = DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")
End Sub

ACT_TRVL is connected to TblAttendance

The problem I am having is that I get an error message (but it still works
ok):

"Object doesn't support this property or method"

How do I get rid of the message or correct this. Also I have noticed that
the field does not show up until I close the form and reopen. Also does this
for some control options within the same form

Please Help And again Thank You
 

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

Dlookup Oject error 0
Assigning a Value 4
Error message while opening document 0
DLookup in Continuous form 0
Yahoo Mail is sending stubborn messages 0
Field from another form 9
Dlookup 2
Dlookup 6

Top