I have a table named tblMatlSpecsChemical. Some of the fields have a value in them and some of them don't have a value. What I want to do, via VBA code, is create a 2nd temporary table that only contains the fields from the 1st table that have values in them.
So if for example table one has a field named C_MIN and that field has a value in it, then include the field name and the field value in the temporary table. But if another field for example named Mn_MIN has no value in the 1st table, then do not include the field name or field value in the temporary table.
I've tried variations of this code but it isn't working so I'm sure I've got something wrong.
Dim RS As DAO.Recordset
Dim rst As DAO.Recordset
Set rst = Nothing
Set RS = CurrentDb.OpenRecordset("tblSpecReportChemical")
If Me!subfrmMatlSpecsChemical.Form!txtC_MIN > 0 Then
RS!C_MIN = Me!subfrmMatlSpecsChemical.Form!txtC_MIN
If Forms!subfrmMatlSpecsChemical.Form.txtMN_MIN > 0 Then
RS!MN_MIN = Forms!subfrmMatlSpecsChemical.Form.txtMN_MIN
MsgBox "The spec data has been entered into the spec report data table."