G
Guest
Ok i have a combo and list box, when i select one value from combo1, it then
populates list1 with specific values. This works fine. The problem that i
have is what is happening on form. When using the navigational buttons,
usually when you get to the end of the table and there is not more data to
view, access will come up with the message 'Cannot go to Specified Record'.
Only this is not happenin, when i click next, it jus creats a blank record
and keeps doing it. I dont want it to do this, i want it to display the error
message when i get to the end of the table only it isnt. It has something to
do with the combo box or list box but i cant figure out what it is. Can
someone help me?
This is the combobox and form coding
**************************************
Private Sub Combo32_AfterUpdate()
On Error Resume Next
List38.RowSource = "Select ScoutGuidesUnit.Unit2 " & _
"FROM ScoutGuidesUnit " & _
"WHERE ScoutGuidesUnit.Unit1 = '" & Combo32.Value & "' " & _
"ORDER BY ScoutGuidesUnit.Unit2;"
End Sub
**************************************
To update the list box when the combo box has been used
********************************************
Private Sub Form_Current()
On Error Resume Next
' Synchronise country combo with existing city
Combo32 = DLookup("[Unit1]", "ScoutGuidesUnit", "[Unit2]='" &
List38.Value & "'")
' Synchronise city combo with existing city
List38.RowSource = "Select ScoutGuidesUnit.Unit2 " & _
"FROM ScoutGuidesUnit " & _
"WHERE ScoutGuidesUnit.Unit1 = '" & Combo32.Value & "' " & _
"ORDER BY ScoutGuidesUnit.Unit2;"
populates list1 with specific values. This works fine. The problem that i
have is what is happening on form. When using the navigational buttons,
usually when you get to the end of the table and there is not more data to
view, access will come up with the message 'Cannot go to Specified Record'.
Only this is not happenin, when i click next, it jus creats a blank record
and keeps doing it. I dont want it to do this, i want it to display the error
message when i get to the end of the table only it isnt. It has something to
do with the combo box or list box but i cant figure out what it is. Can
someone help me?
This is the combobox and form coding
**************************************
Private Sub Combo32_AfterUpdate()
On Error Resume Next
List38.RowSource = "Select ScoutGuidesUnit.Unit2 " & _
"FROM ScoutGuidesUnit " & _
"WHERE ScoutGuidesUnit.Unit1 = '" & Combo32.Value & "' " & _
"ORDER BY ScoutGuidesUnit.Unit2;"
End Sub
**************************************
To update the list box when the combo box has been used
********************************************
Private Sub Form_Current()
On Error Resume Next
' Synchronise country combo with existing city
Combo32 = DLookup("[Unit1]", "ScoutGuidesUnit", "[Unit2]='" &
List38.Value & "'")
' Synchronise city combo with existing city
List38.RowSource = "Select ScoutGuidesUnit.Unit2 " & _
"FROM ScoutGuidesUnit " & _
"WHERE ScoutGuidesUnit.Unit1 = '" & Combo32.Value & "' " & _
"ORDER BY ScoutGuidesUnit.Unit2;"