Hi everyone
I have a series of sql statements that are being executed when a name is selected from a list. These sql statements take the field from the record and apply it to the list in the combo box that the statement is being written on.
I hope that makes sense.
The program executes the majority of the statements, but it gives me a runtime 3021 error on these statements, which are identical to the others.
Set rs = db.Execute("SELECT Teams.[Index], Teams.[LongName], Players.[ColCommit], Players.[Index] " & " FROM Teams, Players WHERE Players.[Index] IN (SELECT Players.[Index] FROM Players WHERE Players.[FirstName] = " & strFN & " AND Players.[LastName] = " & strLN & "
AND Players.[ColCommit] = Teams.[Index]"
cboColCom.Text = rs.Fields("LongName"
.Value & vbNullString
rs.Close
Set rs = Nothing
Set rs = db.Execute("SELECT CollegeYears.[Index], CollegeYears.[Long], Players.[Index], Players.[ColYear] FROM CollegeYears, Players WHERE Players.[Index] IN (SELECT Players.[Index] FROM Players WHERE Players.[FirstName] = " & strFN & " AND Players.[LastName] = " & strLN & "
AND Players.[ColYear] = CollegeYears.[Index]"
cboYear.Text = rs.Fields("Long"
.Value & vbNullString
rs.Close
Set rs = Nothing
Any problems that someone can pick out of this please tell me. I don't understand why it works for some combo boxes but not others.
Thanks
MichHart " Never regret yesterday because it cannot be changed;
Instead make sure today does not become a regret of tomorrow."
I have a series of sql statements that are being executed when a name is selected from a list. These sql statements take the field from the record and apply it to the list in the combo box that the statement is being written on.
I hope that makes sense.
The program executes the majority of the statements, but it gives me a runtime 3021 error on these statements, which are identical to the others.
Set rs = db.Execute("SELECT Teams.[Index], Teams.[LongName], Players.[ColCommit], Players.[Index] " & " FROM Teams, Players WHERE Players.[Index] IN (SELECT Players.[Index] FROM Players WHERE Players.[FirstName] = " & strFN & " AND Players.[LastName] = " & strLN & "
cboColCom.Text = rs.Fields("LongName"
rs.Close
Set rs = Nothing
Set rs = db.Execute("SELECT CollegeYears.[Index], CollegeYears.[Long], Players.[Index], Players.[ColYear] FROM CollegeYears, Players WHERE Players.[Index] IN (SELECT Players.[Index] FROM Players WHERE Players.[FirstName] = " & strFN & " AND Players.[LastName] = " & strLN & "
cboYear.Text = rs.Fields("Long"
rs.Close
Set rs = Nothing
Any problems that someone can pick out of this please tell me. I don't understand why it works for some combo boxes but not others.
Thanks
MichHart " Never regret yesterday because it cannot be changed;
Instead make sure today does not become a regret of tomorrow."