INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

combobox for multiple fields

combobox for multiple fields

(OP)
If I have a table that has these fields:

SrvChrgSize SrvChrgAmt
fld3-2wk 30.00
fld3-6mo 120.00
fld75-2wk 60.00
fld75-6mo 140.00

How would I do the combo box that lets them select the field and corresponding charge?
Currently I have 4 columns horizontal but that's not what I'm really looking for.
I need the combo box to be vertical with 2 columns.

I am currently on office 2010 but they are upgrading us to 2016
Thanks

RE: combobox for multiple fields

Lhuffst,
You have started almost 200 threads and should understand how to use TGML to make your posts more readable.

Can you use TGML and show us your actual table, fields, and data? Then use TGML to show us how you want this represented in the combobox.

Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016

RE: combobox for multiple fields

Quote (dhookom)

You have started almost 200 threads and should understand how to use TGML to make your posts more readable.

In, in fact, you have already done so, multiple times, after been given the same advice before!

Are the Fields SrvChrgSize and SrvChrgAmt in a single Table? If so, base your Combobox on that Table and include both Fields. You can do that by simply using the COmbobox Wizard.

Hope this helps!

There's always more than one way to skin a cat!

All posts/responses based on Access 2003/2007

RE: combobox for multiple fields

(OP)
DHookom
My apologies. I thought that for so few lines it wouldn't be hard to read. I'll correct that in the future.

Yes I have done combo boxes and can use the wizard but this is slightly different so I wasn't sure.

CODE

TblFees 

Fields:
fld2wk3inSvcChrg
fld6mo3inSvcChrg
fld2wk75inSvcChrg
fld6mo75inSvcChg

 svcChrgAmt is the actual values for each field above 
If I use the wizard, I get the following showing in the combo box:
fld2wk3inSvcChrg   fld60mo3inSvcChrg  fld2wk75inSvcChrg   fld6mo75inSvcChrg
      40                    130                40                  130
      120                    120               30                  120 

What I would like the combobox to look like is
fld2wk3inSvcChrg     40
     fld6mo3inSvcChrg     120
     fld2wk75inSvcChrg    40
     fld6mo74inSvcChrg    120 

Previously there was only one field in the table but due to different pricing now, I have to change it to multiple fields
I hope this is more clear and appreciate any help.

RE: combobox for multiple fields

I hope you realize you have created an un-normalized table structure by storing data in field names. You should be able to normalize this with a union query.

I'm not sure how you got the values when there are two records.

CODE --> SQL

Select "fld2wk3inSvcChrg" as TheField, fld2wk3inSvcChrg as Charge
FROM tblFees 
UNION ALL
Select "fld6mo3inSvcChrg", fld6mo3inSvcChrg 
FROM tblFees
UNION ALL 
SELECT "fld2wk75inSvcChrg", fld2wk75inSvcChrg
FROM tblFees
UNION ALL
SELECT "fld6mo75inSvcChg",fld6mo75inSvcChg
FROM tblFees 

Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016

RE: combobox for multiple fields

"I'm not sure how you got the values when there are two records."

Especially when you want this:

"What I would like the combobox to look like is"
     fld2wk3inSvcChrg     40
     fld6mo3inSvcChrg     120
     fld2wk75inSvcChrg    40
     fld6mo74inSvcChrg    120  

Out of this data:
fld2wk3inSvcChrg   fld60mo3inSvcChrg  fld2wk75inSvcChrg   fld6mo75inSvcChrg
      40                    130                40                  130
      120                   120                30                  120  

Aside from what the spelling of the field names are...

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: combobox for multiple fields

(OP)
sorry it's been so long responding - I'm yanked from project to project it seems.
I was hoping to use as much original code as possible from the original coder.
Based on your forms I'm restructuring this one to be normalized. Thanks for the help

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close