MS ACCESS Form field with multiple parts.

Posted on 2011-04-19
Last Modified: 2012-06-21
I currently have a form that collects demographics from a member and stores the data in a db.

The field address is currently a text box. Is it possible to capture the field “Address” from several fields to split the address:  Text field for house number + drop down to select “N” , “S”, “SW” “NW”…etc   + text field for street name/number + Drop down for “AVE”, “ST”, “CT”, “RD”..etc. Then combine all 4 parts into a single db column “Address”??
Question by:sweetbuttercup
    LVL 9

    Accepted Solution

    well , for that u need to add a couple of combo boxes and set these required values in the list property.
    once this is done, add a code to capture all values in the address text box

    for a ref

    txtAddress.text  = txtAddress1.text  + " ," + combo1.text + "," + combo2.text ..... and so on..

    LVL 26

    Assisted Solution

    Why combine them?
    Store them as separate columns.
    It's easy enough to combine them when you go to use them.

    If you do go to combine them, you'd have to code.
    Throw a hidden textbox (txtFullAddress) on the form.
    Bind it to your address field
    In the After Update event of each of your separate controls put

    me.txtFullAddress = nz(me.txtAddress1)  & " ," & nz(me.cboWhatever) & "," & nz(me.combo2)

    Be very careful!

    & is the concatenator not +
    Odd things happen when you make that mistake!
    LVL 74

    Expert Comment

    by:Jeffrey Coachman
    <The field address is currently a text box.>
    A single textbox with the *Entire* Address?
    Is this bound to a single "Address" field?

    If so then you will have to first create all the individual fields, then split this existing field into each of these new fields.

    Can you post some generic data from your table?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now