G
Guest
I have form that allows users to enter data in a spread sheet format, bu I
save in a normalized format.
There are twenty columns. The user can select the column headings. The
objects and fields are numerically ordered.
[Forms]![frmCoC]![Lot Entry Form]![cmbAtt1],
[Forms]![frmCoC]![Lot Entry Form]![cmbAtt2]
FT1, FT2,
I use a while statment to step through each and save as shown below.
aVar = 2
While aVar < 21
qVar = "INSERT .WHERE (((tblZHoldFiberLotNumber.FT" & aVar & ") Is Not
Null));"
DoCmd.RunSQL qVar
aVar = aVar + 1
Wend
This works fine, but I want to know beforehand how many non null column
headings there are. Then I can elimenate any columns left blank. For example
if all columns are used except column #5, currently I would save 1-4, and
6-20. I want to renumber and save 1-19 intead. I would like to use a Whlie
statement to step through each object rather than looking at each
individually. I am using
Check =1
aVar = 1
While avar <21
qVar = [Forms]![frmCoC]![Lot Entry Form]![cmbAtt" & avar & "]"
If IsNull(qVar) = False Then
Check = Check +1
EndIF
Wend
This assigns qVar the literal string value instead of the form value. What
would be the correct syntacts?
Thanks, any help would be appreciated.
save in a normalized format.
There are twenty columns. The user can select the column headings. The
objects and fields are numerically ordered.
[Forms]![frmCoC]![Lot Entry Form]![cmbAtt1],
[Forms]![frmCoC]![Lot Entry Form]![cmbAtt2]
FT1, FT2,
I use a while statment to step through each and save as shown below.
aVar = 2
While aVar < 21
qVar = "INSERT .WHERE (((tblZHoldFiberLotNumber.FT" & aVar & ") Is Not
Null));"
DoCmd.RunSQL qVar
aVar = aVar + 1
Wend
This works fine, but I want to know beforehand how many non null column
headings there are. Then I can elimenate any columns left blank. For example
if all columns are used except column #5, currently I would save 1-4, and
6-20. I want to renumber and save 1-19 intead. I would like to use a Whlie
statement to step through each object rather than looking at each
individually. I am using
Check =1
aVar = 1
While avar <21
qVar = [Forms]![frmCoC]![Lot Entry Form]![cmbAtt" & avar & "]"
If IsNull(qVar) = False Then
Check = Check +1
EndIF
Wend
This assigns qVar the literal string value instead of the form value. What
would be the correct syntacts?
Thanks, any help would be appreciated.