ummmm, Help? ComboBox not selecting

O

Oren Kaplan

Hello All,
I have a ComboBox on my 'Main' Form (the Form is not data
bound, the ComboBox is) which i want the user to be able to
pick from and click on a command that gets the data from the
first column (4 columns are shown) and uses it in some way....
- At first it looks like this:

___________ _ |¯¯¯¯¯¯¯¯¯|
|Select Here|V| | Command |
¯¯¯¯¯¯¯¯¯¯¯ ¯ |_________|

- When you click on the arrow it cascades:

___________ _ |¯¯¯¯¯¯¯¯¯|
|___________|V|_________ ___________ ___________ _ | Command |
| Main ID |¯ Desc. 1 | Desc. 2 | Desc. 3 |^||_________|
|¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯|¯|
| Records | For | User | Selection |_|
|___________|___________|___________|___________|V|
¯
- When you select a record from the list it shows the 'Main
ID' you selected in the text portion of the ComboBox:

___________ _ |¯¯¯¯¯¯¯¯¯|
| Main ID |V| | Command |
¯¯¯¯¯¯¯¯¯¯¯ ¯ |_________|
- And then when you click the Command you can refer to
ComboBox`s value and call a Sub or Function using that value.

Thing is... The ComboBox doesn`t display its DefaultValue at
the begining and when I move the mouse over a record it only
'selects' it, as in highlights it in black, and clicking on
them doesn`t make any difference. In the end the text portion
of the combobox is either empty as usual or full with some
spaces...

Help anyone? Using Access2k over Win2K or NT4.....

Thanks ahead,
Oren
 
?

??????

Oren Kaplan said:
Hello All,
I have a ComboBox on my 'Main' Form (the Form is not data
bound, the ComboBox is) which i want the user to be able to
pick from and click on a command that gets the data from the
first column (4 columns are shown) and uses it in some way....
- At first it looks like this:

___________ _ |¯¯¯¯¯¯¯¯¯|
|Select Here|V| | Command |
¯¯¯¯¯¯¯¯¯¯¯ ¯ |_________|

- When you click on the arrow it cascades:

___________ _ |¯¯¯¯¯¯¯¯¯|
|___________|V|_________ ___________ ___________ _ | Command |
| Main ID |¯ Desc. 1 | Desc. 2 | Desc. 3 |^||_________|
|¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯|¯¯¯¯¯¯¯¯¯¯¯|¯|
| Records | For | User | Selection |_|
|___________|___________|___________|___________|V|
¯
- When you select a record from the list it shows the 'Main
ID' you selected in the text portion of the ComboBox:

___________ _ |¯¯¯¯¯¯¯¯¯|
| Main ID |V| | Command |
¯¯¯¯¯¯¯¯¯¯¯ ¯ |_________|
- And then when you click the Command you can refer to
ComboBox`s value and call a Sub or Function using that value.

Thing is... The ComboBox doesn`t display its DefaultValue at
the begining and when I move the mouse over a record it only
'selects' it, as in highlights it in black, and clicking on
them doesn`t make any difference. In the end the text portion
of the combobox is either empty as usual or full with some
spaces...

Help anyone? Using Access2k over Win2K or NT4.....

Thanks ahead,
Oren
 
A

Arvin Meyer

Nice Ascii art! Thanks for not posting a nice fat jpg.

I'd use the AfterUpdate of the combobox instead of the command button click
event to run your code. If I've missed something else, (i.e. the default
value when there isn't one) you could hard code that value into the command
button something like this: (aircode)

Sub cmdWhatever_Click()
Dim MyVar

MyVar = Me.cboMyCombo

If Len(MyVar & vbNullString) = 0 Then
MyVar = ' The default value
Else
MyVar = MyVar
End If

' Rest of code

End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
O

Oren Kaplan

Hey Arvin,
You said:
Nice Ascii art! Thanks for not posting a nice fat jpg.
<snip>

thanks :) I had to - I didn`t manage to explain my self in a better
way in words and I wouldn`t have gone to the trouble of screen
capturing anything just for that.

I'd use the AfterUpdate of the combobox instead of the command button click
event to run your code.
<snip>

The problem is, though - that the d**n control doesn`t even produce
that event! It doesn`t even get to the point where it changes... I
can`t type in anything and can`t select anything from the list! As
for everything else, well, thanks alot - I`ll keep it on the thread
if others want it but I still need someone to try to understand why
one three different computers and two different systems the combobox
simply won`t let anything happen to it except for the list to cascade
with the right data from the table...

HELP (and thanks :),
Oren
 
O

Oren Kaplan

Hey Arvin,
you said:
It is locked! Go into Design View, select the combo box, open the property
sheet, and select No on the Locked property (Data tab)
<snip>

actually - I found out why - I had bound the CombBox to the
field - so I was trying to enter a selection into an autonumber
field which access obviously didnt like...
I already checked the locked property a few tims before but
never thought I actually didn`t make the connection between
binding the control to an autonumber field and it not doing
anything....
thanks anyway - I posted this for those who might be following
or having the same problems.

take care,
Oren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top