Textbox TAB to appear corresponding text

wotamelon

Registered User.
Local time
Today, 21:24
Joined
Jul 28, 2010
Messages
38
Hi =)

I don't know much about VBA codes so how should I go about doing this?
In my form I wish to enter my suburb followed by its postcode/zipcode.
Thing is a particular suburb has its particular postcode.... so to save time is there a way so that i can type in my [Suburb] then TAB to the [Postcode/zipcode] textbox and the corresponding one will automatically appear?

YAY thx!

can show me vba codes. Im good to go for any hard bits

like i was thinking...

IF Suburb = 'Melbourne' Then Postcode = '3000'
??
 
Last edited:
Why not use a combo box that looks at your suburbs and also the postcode then hide the postcode column and then use a text box to then display the hidden column from the combo so it would be something like this in an event behind the combo box after update event.

me.textboxname.value = me.comboboxname.column(1).value

a combobox which has 2 columns will start the number as 0 (zero) so the second column would be 1.

See if that works for you
 
Here's a practical example of what Trevor G is suggesting.
 

Attachments

Here's a slightly modified version of the DB, now with proper normalisation.

Thx BIGGY and Trevor, you guys have given me a lot of information to munch on!

btw, how did you (BIG BOOTY) get those postcodes data so quicklyoff the net, i tried finding the information as a list to cut and paste but had no luck. And you manage to get all the states and its suburbs too! WOW to you!

Trevor, I'm gonna use just that very idea.! thx heaps
 
They are freely available from the Australia Post site as an Excel down load (those ones are now quite old), and are available here. You will need to put in a little work to normalise them though.
 
They are freely available from the Australia Post site as an Excel down load (those ones are now quite old), and are available here. You will need to put in a little work to normalise them though.


Oh I see.... Australia Post lol.
 
Hi all, I've come across another minor problem, the textbox that displays the postcodes is functioning correctly, however the displayed data isn't storing in the database...

the control source for textbox is : =ComboSuburb.column(2)
In my customer details detail, the column of postcodes is empty, cos data isn't been stored.





____________________________________________________________
+ R.I.P Manila HIJACK VICTIMS
 
Is your ComboSuburb bound to your Table?

It should be storing your SuburbID. Having stored your SuburbID, you don't need to store any other information in your table, as all the other information related to the SuburbID such as Suburb Name, postcode and state, can easily be retrieved for display purposes using a query.
 
My COmboSuburb is bound to my tblCustomer's SUBURB column, instead of storing suburbID, it stores it as the 'name of the suburb' (because I want the title to be displayed in the report instead of the suburbID...

Im trying to understand your concept, but im afriad that my report will show up as numbers instead of names in the textboxes of (suburb and postcodes)
 
You need only store the SuburdID in your Table. Have a read up on the subject of Database Normalisation

Now to populate your Report, you create a query that collects all the information related to SuburbID, and then you simply use that as the Record Source for your Report, to display the relevant related details, such as Suburb Name, State Name and post code
 

Users who are viewing this thread

Back
Top Bottom