R
RichardA
Hello,
I have had no luck entering a calculation to fill a newly added column in a table in design query view, ultimately I am going to need to do this in code. The below code is used to add an empty column by altering table zmax2. Then I execute a make table command. Finally, I need to figure out how to fill the new column based on columns from the two joined tables, zmax2 and rooting2. Can someone tell me how to give the calculation command to make the new column the Minimum of two columns, one from zmax2, the other from rooting2?
Dim strSQL As String
strSQL = "ALTER TABLE zmax2 ADD COLUMN MinMaxzvsr SHORT"
'Turn off warning message.
'DoCmd.SetWarnings False
'DoCmd.RunSQL strSQL
'Re-enable warning message
'DoCmd.SetWarnings True
strSQL = "SELECT zmax2.*, rooting2.* " & _
"INTO temp " & _
"FROM zmax2 LEFT OUTER JOIN rooting2 " & _
"ON zmax2.musym = rooting2.musym"
'Turn off warning message.
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
'Re-enable warning message
DoCmd.SetWarnings True
RichardA
I have had no luck entering a calculation to fill a newly added column in a table in design query view, ultimately I am going to need to do this in code. The below code is used to add an empty column by altering table zmax2. Then I execute a make table command. Finally, I need to figure out how to fill the new column based on columns from the two joined tables, zmax2 and rooting2. Can someone tell me how to give the calculation command to make the new column the Minimum of two columns, one from zmax2, the other from rooting2?
Dim strSQL As String
strSQL = "ALTER TABLE zmax2 ADD COLUMN MinMaxzvsr SHORT"
'Turn off warning message.
'DoCmd.SetWarnings False
'DoCmd.RunSQL strSQL
'Re-enable warning message
'DoCmd.SetWarnings True
strSQL = "SELECT zmax2.*, rooting2.* " & _
"INTO temp " & _
"FROM zmax2 LEFT OUTER JOIN rooting2 " & _
"ON zmax2.musym = rooting2.musym"
'Turn off warning message.
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
'Re-enable warning message
DoCmd.SetWarnings True
RichardA