Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6.0 Data Grid, odd behaviour in Change event

Status
Not open for further replies.

afryer

Programmer
Mar 9, 2004
207
0
0
GB
Hi All,

I have come across a problem today that is really bugging me and hope someone here can help. Basically what is happening is the following:

1) I have a data item which reads in data from table in the database called RECURRING_FREQUENCIES, which contains two fields; RECURRING_FREQUENCY_ID and RECURRING_FREQUENCY_NAME
2) The data source is linked to a DBCombo called db_recurreceFreq
3) The Change event for the drop-down is defined as there is one option in the database, which requires some other objects to be enabled.
4) If the user selects an option other than the checked one then it all works fine, but if they do select the checked one then the BoundText portion of the drop down suddenly contains RECURRING_FREQUENCY_NAME instead of RECURRING_FREQUENCY_ID
5) I have tried recreating all the onjects, but to no avail!

My code for the Change even is as follows:

Code:
    ' if it is user defined then enable the disabled text boxes
    
    
    If (Me.db_recurrenceFreq = "User-defined") Then
    
        
        Me.label_userFreq.Enabled = True
        Me.text_userInterval.Enabled = True
        Me.combo_userFrequency.Enabled = True
        Me.text_userInterval.SetFocus
        
        
        
    ' otherwise disable them
        
    Else
        Me.label_userFreq.Enabled = False
        Me.text_userInterval.Enabled = False
        Me.combo_userFrequency.Enabled = False
    End If

Any help would be appreciated as I am tearing my hair out on this one!
 
Sorry, the title should say DBCombo
 
Personally, I avoid data binding like the plague, preferring to use an ordinary combo box and handle binding myself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top