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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnLoad Event not running after using upsize wizard

Status
Not open for further replies.

jamiesadler

Programmer
Jan 10, 2001
8
GB
I have just upsized my database to run on an SQL server
Now code I have in the Onload event does not run.
Any ideas?
 
I am currently using the following code in the OnOpen event

Private Sub Form_Open(Cancel As Integer)
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

'Use the ADO connection that Access uses
Set cn = CurrentProject.AccessConnection

'Create an instance of the ADO Recordset class, and
'set its properties
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "SELECT * FROM tblGoodsOut WHERE lngGoodsOutID = " & CStr(modAct.GoodsID)
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open
End With

'Set the form's Recordset property to the ADO recordset
Set Me.Recordset = rs

Set rs = Nothing
Set cn = Nothing


End Sub

If this code is used the onload event does not run.
(I put a msgbox in to check)

If I take this out and bind the form to a table for example the onload event runs.

I am currently using XP Developer to write an access ADP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top