Originally Posted by
NightWalker
I am thinking the form is unbound therefore if my thinking is correct it will not pull the rest of the information. I would create a query to find the scar# then input the info back into the table from the query using a recordset. I may be wrong as i am still learning this myself.
i'm thinking something like this:
Code:
docmd.openform "fMyFormA"
'Sets table "tbl_YourDataTable" as recordset
Set dbTest = CurrentDb
Set rstTestData = dbTest.OpenRecordset("tbl_YourDataTable")
With rstTestData
IF rstTestData!Scar = Forms!FormB!txtboxwithscar.value then
txtArea = rstTestData!Area ' change txtArea with your control name for the area textbox and the Area after rstTestData! is your field name
txtStatement = rstTestData!Statement
'keep going for all the items you want to have data for
End If
End With
Set rstTestData = Nothing
Hi All,
I thought i've solved the issue with Dlookup.
But i'm not sure why it always show up the data in the table from the 1st row.
Code:
Private Sub btnback_Click()
DoCmd.OpenForm ("F1NCForm")
Forms!F1NCform!txtscar = Forms!F2CAPAform!txtscar
Forms!F1NCform!txtarea = DLookup("Area", "F1NCtbl", Forms!F1NCform!txtscar)
Forms!F1NCform!txtstatement = DLookup("Statement", "F1NCtbl", Forms!F1NCform!txtscar)
Forms!F1NCform!txtreq = DLookup("Requirement", "F1NCtbl", Forms!F1NCform!txtscar)
Forms!F1NCform!txtoe = DLookup("Objective_Evidence", "F1NCtbl", Forms!F1NCform!txtscar)
Forms!F1NCform!txtlink = DLookup("Hyperlink", "F1NCtbl", Forms!F1NCform!txtscar)
Forms!F1NCform!txtoe = DLookup("Objective_Evidence", "F1NCtbl", Forms!F1NCform!txtscar)
Forms!F1NCform!cmbdept = DLookup("Assigned_to_dept", "F1NCtbl", Forms!F1NCform!txtscar)
Forms!F1NCform!cmbeid = DLookup("Assigned_to_Eid", "F1NCtbl", Forms!F1NCform!txtscar)
Forms!F1NCform!txtEID = DLookup("Prepared_by", "F1NCtbl", Forms!F1NCform!txtscar)
Forms!F1NCform!txtdate = DLookup("Date", "F1NCtbl", Forms!F1NCform!txtscar)
Any suggestion?