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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|