Microsoft Office Tutorials and References
In Depth Information
Making a Wizard with Tabbed Control
The code is a simple update of the row in the tblSystem and the formatting of
the number:
Function fncGetNewOrdernumber() As String¶
' Function to get a new ordernumber in the format yyyy9999¶
Dim rs As DAO.Recordset¶
' open tblSystem¶
Set rs = CurrentDb.OpenRecordset(tblSystem)¶
' make sure first (and only) row is available¶
rs.MoveFirst¶
' update row¶
rs.Edit¶
rs!orderid = rs!orderid + 1¶
' create ordernumber as string with four fixed digits¶
fncGetNewOrdernumber = rs!orderyear & Format(rs!orderid, 0000)¶
rs.Update¶
Set rs = Nothing¶
End Function¶
The year increment code is almost identical; only the rs.Edit is different:
rs.Edit¶
rs!orderyear = rs!orderyear + 1¶
rs!orderid = 1¶
' create ordernumber as string with four fixed digits¶
fncStartNewYearOrdernumber = rs!orderyear & Format(rs!orderid, 0000)¶
rs.Update¶
Making a Wizard with Tabbed Control
Acs
This procedure demonstrates how to force users to fill in fields in a predefined
sequence.
Example file:
A019.mdb with
form frmWizard
Scenario: To direct the input of the user, you would
normally use a wizard. In a previous example, we
demonstrated how to check entered data when the user
pressed the Save button. Sometimes, values to be displayed
in a field are determined by previous field selections. In this
instance, a wizard can be used to assist the user.
 
Search JabSto ::




Custom Search