Hi everyone!
I've got a 2010 access database that was coverted from an access backend to an sql backend. There is one form in the sql version that will not display. It works correctly in the access version. In the sql version, it produces a tab and a blank screen. If I go into design mode, properties, I can see the data for the combo-boxes. The form consists of 2 date fields, 2 combo boxes, 2 radio buttons, along with cancel and execute buttons. The code appears to be pretty straight forward. I have stepped thru the code, and by using debug.print, can see the data being set to the appropriate fields. Any thoughts as to what is going on? The code is below:
Private Sub cmdFpList_Click()
sFPFlag = "n"
DoCmd.OpenForm "frmForcedPoolReport", acNormal, , , acFormEdit, acWindowNormal
sFPFlag = "n"
End Sub
Private Sub Form_Load()
Dim SqlStr As String
Dim cn As New ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = CurrentProject.AccessConnection
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
End With
Me.cmbLease.RowSource = ""
Me.cmbLease.AddItem "<< ALL LEASES >>", 0
Me.txtStartDate = #1/1/2004#
Me.txtEndingDate = Format(Now(), "mm/dd/yy")
SqlStr = "Select LR_LSM_LEASECOD From MRI_LRLMSTR Order By LR_LSM_LEASECOD"
rs.Open SqlStr
Do While rs.EOF = False
Me.cmbLease.AddItem rs("LR_LSM_LEASECOD")
rs.MoveNext
Loop
If rs.State = adStateOpen Then rs.Close
SqlStr = "select PetroID from LeaseInfo where PetroID is not null group by PetroID order by PetroID"
rs.Open SqlStr
Do While rs.EOF = False
Me.cmbOwner.AddItem rs("PetroId")
rs.MoveNext
Loop
If rs.State = adStateOpen Then rs.Close
End Sub
Thank you for your help!!!!
I've got a 2010 access database that was coverted from an access backend to an sql backend. There is one form in the sql version that will not display. It works correctly in the access version. In the sql version, it produces a tab and a blank screen. If I go into design mode, properties, I can see the data for the combo-boxes. The form consists of 2 date fields, 2 combo boxes, 2 radio buttons, along with cancel and execute buttons. The code appears to be pretty straight forward. I have stepped thru the code, and by using debug.print, can see the data being set to the appropriate fields. Any thoughts as to what is going on? The code is below:
Private Sub cmdFpList_Click()
sFPFlag = "n"
DoCmd.OpenForm "frmForcedPoolReport", acNormal, , , acFormEdit, acWindowNormal
sFPFlag = "n"
End Sub
Private Sub Form_Load()
Dim SqlStr As String
Dim cn As New ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = CurrentProject.AccessConnection
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
End With
Me.cmbLease.RowSource = ""
Me.cmbLease.AddItem "<< ALL LEASES >>", 0
Me.txtStartDate = #1/1/2004#
Me.txtEndingDate = Format(Now(), "mm/dd/yy")
SqlStr = "Select LR_LSM_LEASECOD From MRI_LRLMSTR Order By LR_LSM_LEASECOD"
rs.Open SqlStr
Do While rs.EOF = False
Me.cmbLease.AddItem rs("LR_LSM_LEASECOD")
rs.MoveNext
Loop
If rs.State = adStateOpen Then rs.Close
SqlStr = "select PetroID from LeaseInfo where PetroID is not null group by PetroID order by PetroID"
rs.Open SqlStr
Do While rs.EOF = False
Me.cmbOwner.AddItem rs("PetroId")
rs.MoveNext
Loop
If rs.State = adStateOpen Then rs.Close
End Sub
Thank you for your help!!!!