You Cancelled the previous Operation 2001

N

Nancy Carol

I have worked on this for 21 straight days.

I cannot count the nuber of things I have done. Reload Access 97, Access
2000, even tried Access on Vista and am currentlly running Offiice 2002.

I have rebuilt my database about 25 times.

Still get the same message.

I tried firing the instruction with a command button - Failed.
Tried on Get Focus - Failed
Tried on Current Event - Failed
Tried on Activate Event - Failed.

Below are three commands I have used.

Dim strUniv As String

strUniv = Me!UNIVCODE

' Me!TextUV = DLookup("[UvName]", "UNVRSTY", "[GCUVCDE] = " &
strUniv)
The above code fails.

Original Code

Me!TextUV = DLookup("[UvName]", "UNVRSTY", "[GCUVCDE] = " &
Forms!CarolV!UNIVCODE)

This code fails.

Me!TextUV = DLookup("[UvName]", "UNVRSTY", "[GCUVCDE] = 'WYO'")

As a test the above code works!

Any Ideas are welcome.

Thank You in Advance

Nancy Carol
 
M

Marshall Barton

Nancy said:
I tried firing the instruction with a command button - Failed.
Tried on Get Focus - Failed
Tried on Current Event - Failed
Tried on Activate Event - Failed.

Below are three commands I have used.

Dim strUniv As String

strUniv = Me!UNIVCODE

' Me!TextUV = DLookup("[UvName]", "UNVRSTY", "[GCUVCDE] = " &
strUniv)
The above code fails.

Original Code

Me!TextUV = DLookup("[UvName]", "UNVRSTY", "[GCUVCDE] = " &
Forms!CarolV!UNIVCODE)

This code fails.

Me!TextUV = DLookup("[UvName]", "UNVRSTY", "[GCUVCDE] = 'WYO'")

As a test the above code works!


The difference between the one that works and the others is
the apostrophes. To put them in the other ones,try using:

Me!TextUV = DLookup("UvName", "UNVRSTY", "GCUVCDE = '" &
Forms!CarolV!UNIVCODE & "' ")
 
N

Nancy Carol

Thank You, It Works.

I could not find a single example that showed me what you did. I understand
what I was doing wrong now.

Hope you have a great Halloween!

Nancy Carol

Marshall Barton said:
Nancy said:
I tried firing the instruction with a command button - Failed.
Tried on Get Focus - Failed
Tried on Current Event - Failed
Tried on Activate Event - Failed.

Below are three commands I have used.

Dim strUniv As String

strUniv = Me!UNIVCODE

' Me!TextUV = DLookup("[UvName]", "UNVRSTY", "[GCUVCDE] = " &
strUniv)
The above code fails.

Original Code

Me!TextUV = DLookup("[UvName]", "UNVRSTY", "[GCUVCDE] = " &
Forms!CarolV!UNIVCODE)

This code fails.

Me!TextUV = DLookup("[UvName]", "UNVRSTY", "[GCUVCDE] = 'WYO'")

As a test the above code works!


The difference between the one that works and the others is
the apostrophes. To put them in the other ones,try using:

Me!TextUV = DLookup("UvName", "UNVRSTY", "GCUVCDE = '" &
Forms!CarolV!UNIVCODE & "' ")
 

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

Top