G
Guest
Hello, I hope you can help me here. I have never programed in MS Access before although I have programed in ASP (several years ago) so I 'm basicly a newbie. I don't know if I have anything correct and I'm not sure what I'm supposed to put in the form property's boxes, so any and all help is appreciated. I'm trying to make one combo box change based on the entry of another.
The first como box is called position the second is called crewname. If calling on queries is easier, I can to that too. This is what I have thus far, but it doesn't seem to work at all. And do I need to change any code for the second combo box? Also I get a Compile error: Method or data member not found. It highlights ".crewname" after the final End if
Private Sub position_AfterUpdate(
On Error GoTo Err_position_Clic
Dim name_sel As Strin
If position = "HAC" The
name_sel = "SELECT Pilots.name FROM Pilots WHERE Pilots.ac command = Yes ORDER BY Pilots.name;
If position = "Co-Pilot" The
name_sel = "SELECT Pilots.name FROM Pilots ORDER BY Pilots.name;
If position = "Crewchief" The
name_sel = "SELECT Aircrew.name FROM Aircrew WHERE Aircrew.crewchief = Yes ORDER BY Aircrew.name;
If position = "Second Crew" The
name_sel = "SELECT Aircrew.name FROM Aircrew ORDER BY Aircrew.name;
If position = "Corpsman" The
name_sel = "SELECT Corpsman.name FROM Corpsman ORDER BY Corpsman.name;
If position = "Guest" The
name_sel = "SELECT Guest.name FROM Guest ORDER BY Guest.name;
End I
End I
End I
End I
End I
End I
Me.crewname.RowSource = name_se
Err_position_Click
MsgBox Err.Descriptio
Resume Exit_position_AfterUpdat
End Su
Again Thank you
The first como box is called position the second is called crewname. If calling on queries is easier, I can to that too. This is what I have thus far, but it doesn't seem to work at all. And do I need to change any code for the second combo box? Also I get a Compile error: Method or data member not found. It highlights ".crewname" after the final End if
Private Sub position_AfterUpdate(
On Error GoTo Err_position_Clic
Dim name_sel As Strin
If position = "HAC" The
name_sel = "SELECT Pilots.name FROM Pilots WHERE Pilots.ac command = Yes ORDER BY Pilots.name;
If position = "Co-Pilot" The
name_sel = "SELECT Pilots.name FROM Pilots ORDER BY Pilots.name;
If position = "Crewchief" The
name_sel = "SELECT Aircrew.name FROM Aircrew WHERE Aircrew.crewchief = Yes ORDER BY Aircrew.name;
If position = "Second Crew" The
name_sel = "SELECT Aircrew.name FROM Aircrew ORDER BY Aircrew.name;
If position = "Corpsman" The
name_sel = "SELECT Corpsman.name FROM Corpsman ORDER BY Corpsman.name;
If position = "Guest" The
name_sel = "SELECT Guest.name FROM Guest ORDER BY Guest.name;
End I
End I
End I
End I
End I
End I
Me.crewname.RowSource = name_se
Err_position_Click
MsgBox Err.Descriptio
Resume Exit_position_AfterUpdat
End Su
Again Thank you