Results 1 to 10 of 10
  1. #1
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183

    NEED HELP in combo box

    So I have a list in combo box - A.M., P.M. or LUNCH



    If the user chooses A.M. then I would like it to save it to tblTest column called AM
    If the user chooses P.M. from the combo list then I would like it to save it to tblTest column called PM

    Is it possible to create something like this? maybe create expression in control source? but does anyone knows the code ?
    or maybe SQL Statement will work?

    PLEASE HELP!

    thanks!

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    The combo box can only be bound to 1 underlying field. If you have separate fields in the table, I believe you have a structural issue that needs to be addressed. Could you please provide more details about your tables/fields and what some background on the business process you are modeling with the database?

  3. #3
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    sk88,
    Is your combo box bound to a field in a Table?
    Or is it unbound?

  4. #4
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183
    Quote Originally Posted by Robeen View Post
    sk88,
    Is your combo box bound to a field in a Table?
    Or is it unbound?

    The combo box is actually unbound.
    or should it be bound to a field first?

  5. #5
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183
    Quote Originally Posted by jzwp11 View Post
    The combo box can only be bound to 1 underlying field. If you have separate fields in the table, I believe you have a structural issue that needs to be addressed. Could you please provide more details about your tables/fields and what some background on the business process you are modeling with the database?

    I have a form where the user will have to record each time (i.e. A.M., LUNCH, OR PM) for seperate days.

    To avoid building three different forms for A.M., LUNCH and P.M.
    I thought maybe the best is to have one form. So if the user chooses A.M. from the combo list, A.M. section of the form will appear. If it chooses LUNCH, the lunch section will appear. AND if it chooses P.M., the P.M. section of the form will appear.


    Basically, in the end, I would like to see A.M., LUNCH and P.M. seperately in the query.

    If I set the combo to one field in the table then it would overwrite it and I won't know whether it is A.M. LUNCH OR P.M,

    I hope you understand what I am trying to explain. I know I made it sound confusing.

    It is just the combo list that i have facing trouble. The rest seems to be fine so far.

    Thanks!


  6. #6
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    What you want to do with the form is fine, but what do the underlying tables look like?

  7. #7
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    No - your Combo Box does not have to be bound to a field - unless you want what the user selects in that combo box to automatically end up in a particular field in a Table - in which case you would bind the combo box to that field.

    What exactly are you wanting to do when the user selects either AM or PM?
    If the user chooses A.M. then I would like it to save it to tblTest column called AM
    . . . what is 'it'? Are you referring to 'A.M.'?
    Do you want 'A.M.' to be put into the [AM] field in that Table?

    It's not real clear to me.

  8. #8
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183
    Quote Originally Posted by Robeen View Post
    No - your Combo Box does not have to be bound to a field - unless you want what the user selects in that combo box to automatically end up in a particular field in a Table - in which case you would bind the combo box to that field.

    What exactly are you wanting to do when the user selects either AM or PM?

    . . . what is 'it'? Are you referring to 'A.M.'?
    Do you want 'A.M.' to be put into the [AM] field in that Table?

    It's not real clear to me.

    Oh yes.. .that is what I want.. IF A.M. then save it to AM field in that table. But what if I want more than just one..

    IF A.M. then put into AM field in that TABLE
    IF P.M. then put into PM field in that TABLE
    IF LUNCH then put into LUNCH field in that table

    as you see, there will be three different FIELD.
    Is it possible? I know how to do ONE.. but not sure about 3

  9. #9
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    If you provide your table structure (or a zipped copy of your database with any sensitive data removed), it will help us better understand so that we can get you to a solution.

  10. #10
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183
    Quote Originally Posted by jzwp11 View Post
    If you provide your table structure (or a zipped copy of your database with any sensitive data removed), it will help us better understand so that we can get you to a solution.
    okay.
    will upload a zipped file soon.

    thanks!

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

Similar Threads

  1. Replies: 2
    Last Post: 11-30-2011, 08:44 PM
  2. Replies: 4
    Last Post: 08-16-2011, 05:54 PM
  3. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  4. Replies: 1
    Last Post: 08-26-2009, 10:45 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