The following is the VBA code I wrote to update a table from a form. I have two questions.
First I want to divide the form entries:
Me.txtXM / Me.txtTM and update the table field XMPERC as a Percentage with 2 decimal places.
Second I need to close the open form frmSR1 and reopen frmEvalMenu.
What is the syntax for this?
Private Sub Command27_Click()
'Update tbl_SR1 with Blood Data
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tbl_SR1", dbOpenDynaset)
rs.Fields("ProviderID") = Me.Text16
rs.Fields("XM") = Me.txtXM
rs.Fields("TX") = Me.txtTX
rs.Fields("RptDate") = Me.Text20
rs.Fields("XMPERC") = Format(Me.txtXM / Me.txtTX, "000.00")
Set rs = Nothing
'Clear All Selections and Return to Physician Evaluation Menu
DoCmd.Close acForm, "frm_SR1"