help opening a form

teiben

Registered User.
Local time
Today, 19:31
Joined
Jun 20, 2002
Messages
462
I have a listbox cboSpec2(not mutliselect) that suppose to open frmresults. the sql is - which works!

SELECT tblExercise.exercisename, tblExercise.idMuscleGroup FROM tblmusclegroup INNER JOIN tblExercise ON tblmusclegroup.idMuscleGroup = tblExercise.idMuscleGroup WHERE (((tblExercise.idMuscleGroup)=[Forms]![frmExerciseSelector]![cboMuscleGroup])) ORDER BY tblExercise.idMuscleGroup;

I've tried many, many variations of w/no success - any suggestions.

docmd.OpenForm "frmresults",acNormal cbospec2.Value
 
docmd.OpenForm "frmresults",acNormal cbospec2.itemdata

btw, why is your listbox named cbospec2 and not lstspec2?

hth.
 
OMG you are the greatest! you have NO idea how much time I have into this! Reasons being, initially the listbox was a combobox, hence the name; when I needed it to display all the results a changed it, probably got interupted and didn't change the name....hence I've been trying to code for a combobox when I realized yesterday evening in the pm that it was really a listbox
 
wrong record

The listbox cboSpec2 opens up frmresults, but the wrong record, it seems to always select first record - using

Private Sub cboSpec2_AfterUpdate()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmresults"
DoCmd.OpenForm "frmresults", acNormal, cboSpec2.Value
End Sub

frmresults rowsourse is: SELECT tblExercise.exercisename, tblExercise.idMuscleGroup, tblExercise.ID, tblExercise.Instructions, tblExercise.Equipment, tblExercise.advinstructions, tblExercise.ImagePath FROM tblExercise WHERE (((tblExercise.idMuscleGroup)=[Forms]![frmExerciseSelector]![cboMuscleGroup]));

I'm sure it's something stupid, any ideas
 
which form is cboSpec2 on, and what's the row source (query) of cboSpec2?
 
cbospec2 is on frmExerciseSelector; the rowsource is SELECT tblExercise.exercisename, tblExercise.idMuscleGroup FROM tblExercise WHERE (((tblExercise.idMuscleGroup)=[Forms]![frmExerciseSelector]![cboMuscleGroup])) ORDER BY tblExercise.idMuscleGroup;

attached are the 2 tables...starting to think it's in there somewhere
 

Attachments

  • relationsship.jpg
    relationsship.jpg
    67 KB · Views: 93

Users who are viewing this thread

Back
Top Bottom