Table/Form Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Got a feeling I'm doing this all wrong, but here goes

I have a form with a field "Postcode" that is generated by a Dlookup expression. This works fine, but when I need to run a query the Postcode field is blank in my table

How do I get the "Postcode" field to populate in my table

My Dlookup is : =DLookUp("[Postcode] ","[Suburb]","[Suburb]![Sub] =" & "[Suburb]"

Thank

Alfie
 
You Postcode field on your form needs to be bound to the Postcode field on
your table.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Alfie said:
Got a feeling I'm doing this all wrong, but here goes.

I have a form with a field "Postcode" that is generated by a Dlookup
expression. This works fine, but when I need to run a query the Postcode
field is blank in my table.
How do I get the "Postcode" field to populate in my table?

My Dlookup is : =DLookUp("[Postcode] ","[Suburb]","[Suburb]![Sub] =" & "[Suburb]")

Thanks

Alfie
 
Lynne

Thanks for replying so quickly

I can't bind the control on the form to the table as the field has the dlookup expr in it

Alfie
 
In addition to Lynn's comment, your DLookup statement is incorrect. It's
trying to lookup the Postcode for the literal value [Suburb]. I assume you
actually want it to look at the value contained in a field on your form
named Suburb.

=DLookUp("[Postcode] ","[Suburb]","[Suburb]![Sub] ='" & Me.[Suburb] & "'")

Exagerated for clarity, that's

=DLookUp("[Postcode] ","[Suburb]","[Suburb]![Sub] =' " & Me.[Suburb] & " '
")

If there's a chance that the suburb might contain an apostrophe, you'd be
better off using:

=DLookUp("[Postcode] ","[Suburb]","[Suburb]![Sub] =" & Chr$(34) &
Me.[Suburb] & Chr$(34))


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Alfie said:
Got a feeling I'm doing this all wrong, but here goes.

I have a form with a field "Postcode" that is generated by a Dlookup
expression. This works fine, but when I need to run a query the Postcode
field is blank in my table.
How do I get the "Postcode" field to populate in my table?

My Dlookup is : =DLookUp("[Postcode] ","[Suburb]","[Suburb]![Sub] =" & "[Suburb]")

Thanks

Alfie
 

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


Back
Top