My Assistant
![]() ![]() |
|
|
Apr 24 2011, 11:27 AM
Post
#1
|
|
|
UtterAccess Certified! Posts: 6,937 From: Arizona, United States |
I have a table with a field called Channel.
I only want there to be 2 possible values in this field, which will come from a data entry form that various users will access. the two possible values I want to be RELS and Bank Direct. Having been advised before on this forum that it was better to avoid using some of the trickier field datatypes in the Table design (like lookup or combo/list), and instead address them at the point of data entry,...which kind of made sense to me because having table fields whose design was something like that tended to complicate the running of queries........I have the field as simply Text type in the table. But I want on my data entry form to have a combobox or listbox (I was thinking listbox so the users can always see the values displayed as choices, and there are only 2 anyway). I'm a little confused on how to do this. I created an unbound listbox on my form, then changed its record source to the field Channel but then when I added code: CODE Private Sub listchannel_Enter() it told me the record source type had to be changed to Value List, which makes it unbound again.Me.listchannel.AddItem "Bank Direct", 1 Me.listchannel.AddItem "RELS", 2 End Sub How do I get users to only choose from 2 options to put in this field, without changing table design? PS. I mean I could use checkboxes or something, but that wouldn't be bound to anything and would require some additional coding that I'm uncertain of, to get the value in the table field at the same time the form updates everything else which is all bound. This post has been edited by ipisors: Apr 24 2011, 11:31 AM |
|
|
|
Apr 24 2011, 11:52 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 17,643 From: Don Mills, ON (Canada) |
I think you may have misinterpretted the error message you got. It was telling you to change the RowSourceType property to Value List (from the default Table/Query setting). That shouldn't change the list box from bound to unbound.
That being said, I don't understand why you would bother using code to set the choices if they're always going to be the same. Set the list box once, and leave it. |
|
|
|
Apr 24 2011, 12:14 PM
Post
#3
|
|
|
UtterAccess Certified! Posts: 6,937 From: Arizona, United States |
I guess my confusion is how do I make a listbox, bound to the table where the values are going into, but only with 2 possible choices.
|
|
|
|
Apr 24 2011, 01:09 PM
Post
#4
|
|
|
UtterAccess VIP Posts: 17,643 From: Don Mills, ON (Canada) |
Easiest way is to use the wizard.
Failing that, do the following:
|
|
|
|
Apr 24 2011, 05:08 PM
Post
#5
|
|
|
UtterAccess Certified! Posts: 6,937 From: Arizona, United States |
when I used the wizard, none of the options, worded as such, were obvious to me as being what I needed so I was not sure if I was doing it right. Thanks for the bullet list, that gets my understanding further than the wizard. I just needed to understand clearly that ControlSource was were the data was going (bound to), and everything relating to Row- had to do with the options that would appear in the box.
As always thanks Doug! |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 23rd May 2013 - 10:36 PM |