JaedenRuiner
Registered User.
- Local time
- Today, 01:22
- Joined
- Jun 22, 2005
- Messages
- 154
Okay,
I have a listbox that populates it's values from a table. Upon the click() event, I run a script to determine the current record for the rest of the form. One of which is an TextBox bound a field in the table the ListBox is populated from.
I store the old values in the Form_Current() method, and allow the user to change the values in the TextBox, and upon textbox_change() I enable an 'Apply' command button.
When the Apply Button is pushed, I set the "saved" data to the actual current data (since the control is bound to a record field), and thus the changes are fully applied. However, I cannot seem to get the ListBox to update it's 'text' display to represent the changed value from the textbox.
I have tried ListBox.requery, but it doesn't work instantly...it sometimes is delayed until I change "apply" a new set of changes.
Why is this?
Specifics:
Table
AreaID (AutoNumber)
Area (Text)
Query
Table.*
AreaList.RowSource = Table
AreaEdit.ControlSource = Area
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner
I have a listbox that populates it's values from a table. Upon the click() event, I run a script to determine the current record for the rest of the form. One of which is an TextBox bound a field in the table the ListBox is populated from.
I store the old values in the Form_Current() method, and allow the user to change the values in the TextBox, and upon textbox_change() I enable an 'Apply' command button.
When the Apply Button is pushed, I set the "saved" data to the actual current data (since the control is bound to a record field), and thus the changes are fully applied. However, I cannot seem to get the ListBox to update it's 'text' display to represent the changed value from the textbox.
I have tried ListBox.requery, but it doesn't work instantly...it sometimes is delayed until I change "apply" a new set of changes.
Why is this?
Specifics:
Table
AreaID (AutoNumber)
Area (Text)
Query
Table.*
AreaList.RowSource = Table
AreaEdit.ControlSource = Area
Code:
Private Sub AreaEdit_Change()
Dim St As String
St = AreaEdit.Text
Debug.Print "Chg Text: " & St
Call UpdateChanges(True)
End Sub
Private Sub UpdateChanges(ByVal Value As Boolean)
ChangesMade = Value
ApplyBtn.Enabled = ChangesMade
End Sub
Private Sub ApplyBtn_Click()
AreaList.SetFocus 'this is because you can't disable a control (the applybtn) when it has the focus
AreaList.Requery '<==== THis is supposed to repopulate the listbox, but it doesn't do it.
Call Form_Current 'this just stores the current values of the actual record into temp variables
Call UpdateChanges(False)
End Sub
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner