Using ADO in vb6.0
I have created a binding collection using a class module as my data source. The binding collection binds text boxes.
I am binding one record of a one record recordset.
My Form Load event:
Private Sub Form_Load()
'Fill screen with form
frmF1Screen.Move 0, 0, Screen.Width, Screen.Height
frmF1Screen.KeyPreview = True
'Set objSource as object to represent class module.
'This goes and opens all recordsets in class module and sets up cross reference that
'allows this procedure to reference any recordset in datasource class module and create
'binding objects with reference to datasource class module.
Set objSource = New clsDsEditEmp 'Call data class module to renew recordset when
'strEmployee_Number is changed.
objBindF1Screen.DataMember = "adoRsF1Screen"
Set objBindF1Screen.DataSource = objSource
'Load frmF3Screen 'Load with F1Screen to reduce wait.
objBindF1Screen.Add txtFNAME, "text", "FNAME"
objBindF1Screen.Add txtLNAME, "text", "LNAME"
objBindF1Screen.Add txtMIDDLE, "text", "MIDDLE"
objBindF1Screen.Add txtEMPNO, "text", "EMPNO"
objBindF1Screen.Add txtDEPT, "text", "DEPT"
objBindF1Screen.Add txtSSN, "text", "SSN"
objBindF1Screen.Add txtADDR1, "text", "ADDR1"
objBindF1Screen.Add txtADDR2, "text", "ADDR2"
objBindF1Screen.Add txtCITY, "text", "CITY"
objBindF1Screen.Add txtSTATE, "text", "STATE"
objBindF1Screen.Add txtZIP, "text", "ZIP"
objBindF1Screen.Add txtFEDFILSTAT, "text", "FEDFILSTAT"
objBindF1Screen.Add txtFEDEXEMP, "text", "FEDEXEMP"
objBindF1Screen.Add txtADDFIT, "text", "ADDFIT"
objBindF1Screen.Add txtSTATECODE, "text", "STATECODE"
objBindF1Screen.Add txtSTFILSTAT, "text", "STFILSTAT"
objBindF1Screen.Add txtSTEXEMP, "text", "STEXEMP"
objBindF1Screen.Add txtSTAXCRED, "text", "STAXCRED"
objBindF1Screen.Add txtADDSIT, "text", "ADDSIT"
objBindF1Screen.Add txtFICAEXEMP, "text", "FICAEXEMP"
objBindF1Screen.Add txtFUTAEXEMP, "text", "FUTAEXEMP"
objBindF1Screen.Add txtSUTAEXEMP, "text", "SUTAEXEMP"
objBindF1Screen.Add txtEICSTAT, "text", "EICSTAT"
objBindF1Screen.Add txtLOCCODE, "text", "LOCCODE"
objBindF1Screen.Add txtLOCALABBR, "text", "LOCALABBR"
objBindF1Screen.Add txtPERIODS, "text", "PERIODS"
frmF1Screen.Show
End Sub
I have verified that the binding is good by doing a
ObjBind.Count. When I change the text in a text box and use the Update method for the recordset there are no changes to the single record in the recordset.
Any help would be appreciated.
TNN, Tom
TNPAYROLL@AOL.COM
TOM
I have created a binding collection using a class module as my data source. The binding collection binds text boxes.
I am binding one record of a one record recordset.
My Form Load event:
Private Sub Form_Load()
'Fill screen with form
frmF1Screen.Move 0, 0, Screen.Width, Screen.Height
frmF1Screen.KeyPreview = True
'Set objSource as object to represent class module.
'This goes and opens all recordsets in class module and sets up cross reference that
'allows this procedure to reference any recordset in datasource class module and create
'binding objects with reference to datasource class module.
Set objSource = New clsDsEditEmp 'Call data class module to renew recordset when
'strEmployee_Number is changed.
objBindF1Screen.DataMember = "adoRsF1Screen"
Set objBindF1Screen.DataSource = objSource
'Load frmF3Screen 'Load with F1Screen to reduce wait.
objBindF1Screen.Add txtFNAME, "text", "FNAME"
objBindF1Screen.Add txtLNAME, "text", "LNAME"
objBindF1Screen.Add txtMIDDLE, "text", "MIDDLE"
objBindF1Screen.Add txtEMPNO, "text", "EMPNO"
objBindF1Screen.Add txtDEPT, "text", "DEPT"
objBindF1Screen.Add txtSSN, "text", "SSN"
objBindF1Screen.Add txtADDR1, "text", "ADDR1"
objBindF1Screen.Add txtADDR2, "text", "ADDR2"
objBindF1Screen.Add txtCITY, "text", "CITY"
objBindF1Screen.Add txtSTATE, "text", "STATE"
objBindF1Screen.Add txtZIP, "text", "ZIP"
objBindF1Screen.Add txtFEDFILSTAT, "text", "FEDFILSTAT"
objBindF1Screen.Add txtFEDEXEMP, "text", "FEDEXEMP"
objBindF1Screen.Add txtADDFIT, "text", "ADDFIT"
objBindF1Screen.Add txtSTATECODE, "text", "STATECODE"
objBindF1Screen.Add txtSTFILSTAT, "text", "STFILSTAT"
objBindF1Screen.Add txtSTEXEMP, "text", "STEXEMP"
objBindF1Screen.Add txtSTAXCRED, "text", "STAXCRED"
objBindF1Screen.Add txtADDSIT, "text", "ADDSIT"
objBindF1Screen.Add txtFICAEXEMP, "text", "FICAEXEMP"
objBindF1Screen.Add txtFUTAEXEMP, "text", "FUTAEXEMP"
objBindF1Screen.Add txtSUTAEXEMP, "text", "SUTAEXEMP"
objBindF1Screen.Add txtEICSTAT, "text", "EICSTAT"
objBindF1Screen.Add txtLOCCODE, "text", "LOCCODE"
objBindF1Screen.Add txtLOCALABBR, "text", "LOCALABBR"
objBindF1Screen.Add txtPERIODS, "text", "PERIODS"
frmF1Screen.Show
End Sub
I have verified that the binding is good by doing a
ObjBind.Count. When I change the text in a text box and use the Update method for the recordset there are no changes to the single record in the recordset.
Any help would be appreciated.
TNN, Tom
TNPAYROLL@AOL.COM
TOM