This is probably an easy thing… I have a pretty simple application, two forms/windows, and that’s it. The primary form is for data entry. The second form is for review. Now the second form I don’t want it to open if there is nothing to review. So I set it up to check for valid records, if there is nothing, then close the review and re-open the main… but that isn’t quite working as I planned….
This is code from the main form:
// NONEYA Stand-Alone Meter Reading Application
// Ian McDonald Driver ID: XXXXXXXX
// Started 13 Jun 2024 @ 16:30
// This is my intellectual property
// Variables defined here…
’ – == None == –
// The code that does stuff…
frmReadReview.Show
frmReadMeters.Close
This is code from the second form:
// NONEYA Stand-Alone Meter Reading Application
// Ian McDonald Driver ID: XXXXXXX
// Started 13 Jun 2024 @ 16:30
// This is my intellectual property
// Variables defined here…
Var rsData As RowSet = dbMeters.SelectSQL( “SELECT * FROM tblPreviousReads WHERE statusOf=? ORDER BY rNum ASC”, “A” )
// The code that does stuff…
If( rsData.Column( “rNum” ).StringValue = “” ) Then
MessageBox( “There are currently no records ready for review. Good-bye!” )
frmReadReview.Close
frmReadMeters.Show
Else
lblRnum.Text = rsData.Column( “rNum” ).StringValue
If( rsData.Column( “unitTank” ).StringValue = “Tank” ) Then
txtAddress.Text = rsData.Column( “address” ).StringValue
lblMerSerNum.Text = “Tank Ser #”
ElseIf( rsData.Column( “unitTank” ).StringValue = “” ) Then
txtAddress.Text = rsData.Column( “address” ).StringValue
lblMerSerNum.Text = “Meter Ser #”
Else
txtAddress.Text = rsData.Column( “address” ).StringValue
lblMerSerNum.Text = “Meter Ser #”
End If
txtCurrRead.Text = rsData.Column( “currRead” ).StringValue
txtCustNum.Text = rsData.Column( “acctNum” ).StringValue
txtLastRead.Text = rsData.Column( “lastRead” ).StringValue
txtLastReadDate.Text = rsData.Column( “readDate” ).StringValue
txtMetSerNum.Text = rsData.Column( “unitSerNum” ).StringValue
txtNotes.Text = rsData.Column( “notes” ).StringValue
txtOff.SetFocus
frmReadReview.mthSourceTest( )
Var rsCnt As RowSet = dbMeters.SelectSQL( “SELECT * FROM tblPreviousReads WHERE statusOf=?”, “A” )
Var iRecCnt As Integer = rsCnt.RowCount
lblRecCntr.Text = "1 Of " + iRecCnt.ToString
End If
The problem is the main form never reappears/opens….