Form from XP doesn't work in 2003 ????

M

Maggs

have very simple form which was working last night in
office xp... on client machine running office 2003 I get
nothing but errors... let's start with

Private Sub Form_Load()
Me.Recordset.MoveFirst
' at this point ... NO CURRENT RECORD????
Me!cboRAC = Me.Recordset.[RAC]
Me!cboHospital = Me.Recordset.[Hospital]
End Sub

What am I missing between versions???

Here's another example: (please no comments on sloppy
coding or the multiple attempts at getting the code to
work... ;)

Private Sub cboRAC_AfterUpdate()
On Error GoTo err_cboRAC_AfterUpdate
Dim strFind As String
Dim rst As Recordset

'Set rst = Me.RecordsetClone <-- never worked
Set rst = Me.Recordset
strFind = "[RAC] = """ & Me![cboRAC] & """"

'rst.FindFirst strFind <--- originally didn't work
'rst.FindFirst "[RAC] = " & Me![cboRAC]
rst.FindFirst strFind ' but worked last night?
If rst.NoMatch Then
GoTo diagnose
' MsgBox "Why not found? " & strFind
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
cboHospital = Me.RecordsetClone!Hospital
Me!cboHospital.RowSource = "select
qryRAC2B.hospital from qryRAC2B where qryRAC2B.RAC =
[forms]![frmRAC_Take2B]![cboRAC]"
Me!cboHospital.Requery
Me!cboHospital.SetFocus
End If
rst.Close

exit_cboRAC_Afterupdate:
Exit Sub

err_cboRAC_AfterUpdate:
MsgBox Err.Description

diagnose:
If rst.BOF Then
MsgBox "bof!"
If rst.EOF Then
' I ALWAYS END UP HERE ... but recordset NOT empty!
MsgBox "eof - we have a problem! *******"
End If
Else
If rst.EOF Then
MsgBox "eof"
End If
End If

End Sub

Can ANYONE shed any light on what's going on here????
PLEASE HELP.

Thanks!
 
M

Marshall Barton

Maggs said:
have very simple form which was working last night in
office xp... on client machine running office 2003 I get
nothing but errors... let's start with

Private Sub Form_Load()
Me.Recordset.MoveFirst
' at this point ... NO CURRENT RECORD????
Me!cboRAC = Me.Recordset.[RAC]
Me!cboHospital = Me.Recordset.[Hospital]
End Sub

What am I missing between versions???

Here's another example: (please no comments on sloppy
coding or the multiple attempts at getting the code to
work... ;)

Private Sub cboRAC_AfterUpdate()
On Error GoTo err_cboRAC_AfterUpdate
Dim strFind As String
Dim rst As Recordset

'Set rst = Me.RecordsetClone <-- never worked
Set rst = Me.Recordset
strFind = "[RAC] = """ & Me![cboRAC] & """"

'rst.FindFirst strFind <--- originally didn't work
'rst.FindFirst "[RAC] = " & Me![cboRAC]
rst.FindFirst strFind ' but worked last night?
If rst.NoMatch Then
GoTo diagnose
' MsgBox "Why not found? " & strFind
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
cboHospital = Me.RecordsetClone!Hospital
Me!cboHospital.RowSource = "select
qryRAC2B.hospital from qryRAC2B where qryRAC2B.RAC =
[forms]![frmRAC_Take2B]![cboRAC]"
Me!cboHospital.Requery
Me!cboHospital.SetFocus
End If
rst.Close

exit_cboRAC_Afterupdate:
Exit Sub

err_cboRAC_AfterUpdate:
MsgBox Err.Description

diagnose:
If rst.BOF Then
MsgBox "bof!"
If rst.EOF Then
' I ALWAYS END UP HERE ... but recordset NOT empty!
MsgBox "eof - we have a problem! *******"
End If
Else
If rst.EOF Then
MsgBox "eof"
End If
End If

End Sub


Sure looks like you have a reference to ADO higher in the
list than DAO. Maybe you should just remove the ADO library
reference.
 
G

Guest

I found that by switching between XP and W2K OS in Office 2003 it drops
reference Libraries. It really bites. When you switch OS's and enter the
database it generates compile errors because the the Reference was dropped.
So I Select and add and all is fine. Until I switch OS's again then I need to
repeat process.

Marshall Barton said:
Maggs said:
have very simple form which was working last night in
office xp... on client machine running office 2003 I get
nothing but errors... let's start with

Private Sub Form_Load()
Me.Recordset.MoveFirst
' at this point ... NO CURRENT RECORD????
Me!cboRAC = Me.Recordset.[RAC]
Me!cboHospital = Me.Recordset.[Hospital]
End Sub

What am I missing between versions???

Here's another example: (please no comments on sloppy
coding or the multiple attempts at getting the code to
work... ;)

Private Sub cboRAC_AfterUpdate()
On Error GoTo err_cboRAC_AfterUpdate
Dim strFind As String
Dim rst As Recordset

'Set rst = Me.RecordsetClone <-- never worked
Set rst = Me.Recordset
strFind = "[RAC] = """ & Me![cboRAC] & """"

'rst.FindFirst strFind <--- originally didn't work
'rst.FindFirst "[RAC] = " & Me![cboRAC]
rst.FindFirst strFind ' but worked last night?
If rst.NoMatch Then
GoTo diagnose
' MsgBox "Why not found? " & strFind
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
cboHospital = Me.RecordsetClone!Hospital
Me!cboHospital.RowSource = "select
qryRAC2B.hospital from qryRAC2B where qryRAC2B.RAC =
[forms]![frmRAC_Take2B]![cboRAC]"
Me!cboHospital.Requery
Me!cboHospital.SetFocus
End If
rst.Close

exit_cboRAC_Afterupdate:
Exit Sub

err_cboRAC_AfterUpdate:
MsgBox Err.Description

diagnose:
If rst.BOF Then
MsgBox "bof!"
If rst.EOF Then
' I ALWAYS END UP HERE ... but recordset NOT empty!
MsgBox "eof - we have a problem! *******"
End If
Else
If rst.EOF Then
MsgBox "eof"
End If
End If

End Sub


Sure looks like you have a reference to ADO higher in the
list than DAO. Maybe you should just remove the ADO library
reference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top