PDA

View Full Version : combo box value stored in array bug



edg126
04-22-2011, 12:20 PM
I followed the instructions that is often referenced in this forum
datapigtechnologies.com/flashfiles/combobox2.html

I have a query to select a client name, then a separate combo box with a list of files specific to that client.

Then I want to store the results of the query into a variable:

Dim ClientName As String
Dim fileType As String
ClientName = cboClientName.Value
fileType = cboFileType.Value

However, when I select the nonfirst value, the fileType Variable returns:

Client Master File
cboClientName.AddItem "Client 1"
cboClientName.AddItem "Client 2"


has anyone had this happen before? I have some events for AfterUpdate and Change:

Private Sub cboClientName_AfterUpdate()
Me.cboFileType.Requery
End Sub
Private Sub cboClientName_Change()
txtFileLocation.Value = ""
End Sub

Private Sub cboFileType_Change()
'there is a text box that lists the file directory of the filetype to be 'processesed that is stored in the second column
txtFileLocation.Value = cboFileType.Column(1)

I'm wondering when the a variable is being assigned to the value that it's calling the change/update events?

I also tried to fileType = cboFileType.Column(0) to no avail.

I thought this might be some stupid setting someone else has experienced and can put me in the right direction, otherwise I'll create a better example to recreate and isolate my exception.

THANKS!

edg126
04-22-2011, 01:11 PM
I think it might be because I used a wizard then deleted the options, and not pulling from a table, but I can't seem to find the addvalue "Client1" text anywhere...

edg126
04-22-2011, 01:40 PM
I figured it out after wasting 2 hours. a new line had appeard with the text in one of the data columns. Blah.