-----Original Message-----
Hi Gerald
I have made some progress, in that I discovered I was using the control
source instead of the combo box name in my lines of code. So the program now
does not halt when it reaches these lines of code. However, the second combo
box contains nothing in it after update, regardless of whether I use "Me."
or "Me!".
I wonder if the other lines of code (see below) in my after update function
are preventing the value list from updating:
*************code***************
If ([OperationType1] = "dynamic hipscrew and plate") Then
MsgBox "For this operation, you must enter more details in
another form.", vbExclamation
Cancel = True
Me!OperationSubType.RowSourceType = "Value List"
Me!OperationSubType.RowSource = "A;B;C"
DoCmd.RunMacro StDocNameX
Else
***********end code**************
So when I choose a value in "OperationType1" combo box, if it is "Dynamic
hipscrew and plate", then it should update the value list then run the
macro, which opens another form that allows the user to enter more info
specific to this type of operation and which varies for each type of
operation. As far as the user is concerned, they enter the value in
OperationType1, and once they try another mouse click (for a command button
or down arrow on a combo box) a message box appears and they click ok. Then
the other form opens and they enter more data and press enter. Then they are
returned to the original form (ie. "Operation Form"). I can't see the
problem.
Thanks in advance for any suggestions
Anthony
Gerald Stanley said:
Try
Me.OperationSubType.RowSource = "A;B;C"
instead of
Me!OperationSubType.RowSource = "A;B;C"
Hope That Helps
Gerald Stanley MCSD
-----Original Message-----
Sorry for the confusion, Gerald.
I did as you suggested and set the RowSourceType to "Value
List" in design
view and removed the offending line of code.
Now I am having problems with the second line of code:
Me!OperationSubType.RowSource = "A;B;C".
I think it may be "RowSource" and "RowSourceType" that are
causing the
problems. Perhaps there is some option or object
library(?) that I should
select to make these commands work????
Anthony
Anthony
I did not suggest that you could create different value
lists in the Design View - I said that you should set the
RowSourceType to 'Value List' in the Design View so that
you would not need the line of code that is giving you the
problem.
Regards
Gerald Stanley MCSD
-----Original Message-----
Hi Gerald
Thanks for your response.
1. How would I go about creating different value lists in
design view?
Wouldn't this limit the value list to only one set of
values?
2. I tried your suggestion, but I am still having problems
with the run time
error, so I can't tell yet whether your suggestion works.
Any clues as to
how I can eliminate the error "Run-time error 438: Object
doesn't support
this property or method"?
Thanks Gerald
Anthony
Your code should work as it is but here are a couple of
observations.
1. If the rowSourceType of comboBox operationSubType is
always 'Value List', why not set it as such in the Design
View then you would not have to set it in code.
2. If you RowSource code was trying to show three
items in
the list, it should have read
Me!OperationSubType.RowSource = "A;B;C"
Hope That Helps
Gerald Stanley MCSD
-----Original Message-----
Hi
I have a combo box called OperationSubType, which
contains
a list of values
that I would like to change depending on the value
selected in another combo
box called OperationType. I have looked at various other
posts and web sites
that assume the row source type is a table/query, and
tried to adapt these
to my combo boxes, which have value lists as their row
source types rather
than tables/queries.
I have included the following two lines in the
AfterUpdate
section of the
OperationType combo box:
Me!OperationSubType.RowSourceType = "Value List"
Me!OperationSubType.RowSource = "A" & "B" & "C"
However, when this code is activated, the following
error
occurs as a result
of the first line of code:
"Run-time error 438: Object doesn't support this
property
or method".
Am I able to use a value list in this situation or do I
have to create a new
table to hold the values for "OperationSubType"?
Thanks in advance
Anthony
.
.
.
.