G
Guest
Hi guys,
I cannot seem to figure out two intermittant problems I am having.
1. I have a form recordsetclone and am looping throught the records,
occationally I get the error "NO CURRENT RECORD"
I have done a test on the "absolute position", it says -1 when it should be
0. But this does not happen everytime.
Here is my code in a button that opens the next form:
iSalesOrderID = Me.SalesOrderRef_TxnID
stDocName = "InvoiceCreator"
DoCmd.Close acForm, "SalesOrder", acSaveYes
stLinkCriteria = "[SALESORDERREF_TXNID]=" & iSalesOrderID
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , sType '** pass invoice
type to invoicecreator form
So, I have explicitly ordered the form closed before the next one is opened.
Some reason the object is still opened???
Thanks for any help!
David
Set rsClone = frm.RecordsetClone
With rsClone
Debug.Print "before position:" & .AbsolutePosition
If .EOF Then
MsgBox ("No Records for :" & frm.Name)
Else
Do While Not .EOF
.....
..MoveNext
Loop
.MoveFirst
The other problem is 1 have 2 forms that do different functions but the
source is the same table. So I have actions to close 1 file and open
another. The 2nd form edits the table recordset in load event. But
occationally I get an error that the object cannot be edited because it is
opened (from the other form not being closed properly)
Here is my code:
I cannot seem to figure out two intermittant problems I am having.
1. I have a form recordsetclone and am looping throught the records,
occationally I get the error "NO CURRENT RECORD"
I have done a test on the "absolute position", it says -1 when it should be
0. But this does not happen everytime.
Here is my code in a button that opens the next form:
iSalesOrderID = Me.SalesOrderRef_TxnID
stDocName = "InvoiceCreator"
DoCmd.Close acForm, "SalesOrder", acSaveYes
stLinkCriteria = "[SALESORDERREF_TXNID]=" & iSalesOrderID
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , sType '** pass invoice
type to invoicecreator form
So, I have explicitly ordered the form closed before the next one is opened.
Some reason the object is still opened???
Thanks for any help!
David
Set rsClone = frm.RecordsetClone
With rsClone
Debug.Print "before position:" & .AbsolutePosition
If .EOF Then
MsgBox ("No Records for :" & frm.Name)
Else
Do While Not .EOF
.....
..MoveNext
Loop
.MoveFirst
The other problem is 1 have 2 forms that do different functions but the
source is the same table. So I have actions to close 1 file and open
another. The 2nd form edits the table recordset in load event. But
occationally I get an error that the object cannot be edited because it is
opened (from the other form not being closed properly)
Here is my code: