B
Booleanboy
I have a relatively simple contact database written with MS Access 2000 and
works fine running under Win XP but in Access 2007 running under Windows 7 I
have some problems with one of the forms.
I use a Combo Box (Combo206) at the top of a form to choose the 'Name' field
from a table so that the record can be displayed in the form body. When run
under Access 2007 the list of 'Name' fields is displayed but the form does
not update with the contents of the related record. I've tried converting the
entire file to the new Access 2007 format but this didn't resolve the problem.
How can I fix this? I suspect the problem is with the VB code. Here's the
code which works under A2000:
Sub Combo206_AfterUpdate()
On Error GoTo Err_Combo206_AfterUpdate
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[ID] = " & Me![Combo206]
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit_Combo206_AfterUpdate:
Exit Sub
Err_Combo206_AfterUpdate:
MsgBox Err.Description
Resume Exit_Combo206_AfterUpdate
End Sub
Additionally the code that used to set focus to the Combo Box now doesn't:
Private Sub Form_Open(Cancel As Integer)
Combo206.SetFocus
End Sub
works fine running under Win XP but in Access 2007 running under Windows 7 I
have some problems with one of the forms.
I use a Combo Box (Combo206) at the top of a form to choose the 'Name' field
from a table so that the record can be displayed in the form body. When run
under Access 2007 the list of 'Name' fields is displayed but the form does
not update with the contents of the related record. I've tried converting the
entire file to the new Access 2007 format but this didn't resolve the problem.
How can I fix this? I suspect the problem is with the VB code. Here's the
code which works under A2000:
Sub Combo206_AfterUpdate()
On Error GoTo Err_Combo206_AfterUpdate
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[ID] = " & Me![Combo206]
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit_Combo206_AfterUpdate:
Exit Sub
Err_Combo206_AfterUpdate:
MsgBox Err.Description
Resume Exit_Combo206_AfterUpdate
End Sub
Additionally the code that used to set focus to the Combo Box now doesn't:
Private Sub Form_Open(Cancel As Integer)
Combo206.SetFocus
End Sub