Results 1 to 8 of 8
  1. #1
    huongdl1987 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Posts
    26

    Combo Box

    Hi all,



    I'm new to access and trying to build a form to update client's information. We want to be able to update the client's address if possible. I want to create a check box, saying "current address is the same as old address"; and if it is checked yes, then the current address box would be automatically filled with the old address information. I've attached the file with this post- hopefully it would make more sense.

    I assume it has something to do with Combo Box, and I guess I have to write some codes- I just really don't know where to start!

    Please help me.

    Thank you very much,
    Meo
    Last edited by huongdl1987; 05-26-2011 at 11:37 PM. Reason: Adding Attachment

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,603
    You need to bind the controls of the form to the fields of the RecordSource. In other words, set the ControlSource property for each control. Then data entered or edited in the controls is directly input to the table and will be displayed in the control. No code should be needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    huongdl1987 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Posts
    26
    Sorry, I'm still really confused. Im newbie, so I'm still getting used to Access languages . So, I have to change the Control Source in the check box? or in the actual updated address field? Does that mean I have to use the calculated fields?

    Thank you so much for your reply post! I'm looking forward to the next one. You are a life-saver!

    Thanks,
    Meo
    xoxo

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,603
    Because this is a bound form (has a RecordSource), what you need to do for each data control (textbox, combobox, listbox) on the form is to set the ControlSource property to the corresponding field of the form's RecordSource. This establishes a direct connection to the fields of the table (binding). Any data entered into the controls is passed directly to the table. Any data already in the table will display in the controls. Any edits to the data will pass directly to the table.

    In DesignView, select a control, open Properties dialog if not already, on the Data tab, click the dropdown of the ControlSource property, select appropriate field.

    This is one primary purpose of forms - as a GUI (graphical user interface) for data entry.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    huongdl1987 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Posts
    26
    Hi June7,

    Thank you so much for your fast reply. I'm still very confused.

    So, when I chose the Control Source, an Expression Builder box appears. What should I write?

    I need Access to copy the previous address to the current address box if the checkbox "same address" is checked.

    I'm thinking about something like:

    CurrentAddress: [Previous Address] display when [checkbox]

    but it didn't work.

    Can you please help me again?

    thank you,
    Meo

  6. #6
    huongdl1987 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Posts
    26
    Hi again,

    I found a solution- using the AfterUpdateEvent.

    Here is my code:
    If Me.Check449 Then
    Me.UpdatedMomAddress = Me.strMaternalAddress
    Me.UpdatedMomCity = Me.strMatCity
    Me.UpdatedMomState = Me.strMatState
    Me.UpdatedMomZip = Me.strMatZip
    End If

    However, when I run this code, only the address is updated, not the city, state, and Zip code.

    What else could i do?

    thank you.
    Meo

  7. #7
    huongdl1987 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Posts
    26
    I just solved my own problem.

    Thanks everyone!

  8. #8
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Quote Originally Posted by huongdl1987 View Post
    I just solved my own problem.

    Thanks everyone!
    Glad that your problem is solved!
    Good Luck!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 06-23-2014, 12:19 PM
  2. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  3. Replies: 1
    Last Post: 08-26-2009, 10:45 AM
  4. Replies: 3
    Last Post: 02-26-2009, 10:17 AM
  5. Replies: 0
    Last Post: 08-17-2008, 12:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums