A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Table/Form Question



 
 
Thread Tools Display Modes
  #1  
Old June 7th, 2004, 10:11 PM
Alfie
external usenet poster
 
Posts: n/a
Default Table/Form Question

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
  #2  
Old June 7th, 2004, 10:14 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default Table/Form Question

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" wrote in message
...
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



  #3  
Old June 7th, 2004, 10:46 PM
Alfie
external usenet poster
 
Posts: n/a
Default Table/Form Question

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
  #4  
Old June 7th, 2004, 10:53 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default Table/Form Question

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
http://I.Am/DougSteele
(no e-mails, please!)


"Alfie" wrote in message
...
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.