UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Using A Combo Box On A Subform To, Access 2016    
 
   
Psycoperl
post Dec 3 2019, 01:56 PM
Post#1



Posts: 431
Joined: 11-March 15
From: Somewhere lost in the NY Subways


I have a form (frmStudent_TO) that contains a subform (sfrmConflicts_Testing).
The subform has 2 combo boxes (conflictSeatNumber and conflictSession)I am trying to populate the conflictSeatNumber with a list of seats based on the value of conflictSession and the room code tblSession for the session.

I have the row source for conflictSeatNumber set as
SQL
SELECT tblSeatNumbers.SeatID, tblSeatNumbers.RoomCode, tblSeatNumbers.Region, tblSeatNumbers.Seat, tblSeatNumbers.SessionCode
FROM tblSeatNumbers WHERE (((tblSeatNumbers.RoomCode) In (Select SessionLocationForSeatCode From tblSession Where SessionID = [Forms]![sfrmConflicts_Testing].[conflictSession])) AND ((tblSeatNumbers.SessionCode)=[Forms]![sfrmConflicts_Testing]![sfrmConflicts_Testing].[conflictSession]));

however when I click on conflictSeatNumber I get a prompt from access saying enter parameter value for Forms!sfrmConflicts_Testing.conflictSession.

I cant figure out what is wrong? When I open the subform by itself the dropdown works.

Any help would be appreciated.
This post has been edited by Psycoperl: Dec 3 2019, 01:57 PM
Go to the top of the page
 
theDBguy
post Dec 3 2019, 02:09 PM
Post#2


UA Moderator
Posts: 76,866
Joined: 19-June 07
From: SunnySandyEggo


Hi. Unless it's a typo, after you have fixed the first prompt, I think you will get a second prompt. The root of the problem is in how you reference controls in a subform is different when you reference a control on a standalone or man form. The normal syntax is something like this (for a standalone or a main form).

Forms!FormName.ControlName

But for a subform, that becomes something like this:

Forms!MainFormName.SubformContainerName.Form!ControlName

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
Psycoperl
post Dec 3 2019, 02:20 PM
Post#3



Posts: 431
Joined: 11-March 15
From: Somewhere lost in the NY Subways


Thank you! It worked!

Go to the top of the page
 
theDBguy
post Dec 3 2019, 02:25 PM
Post#4


UA Moderator
Posts: 76,866
Joined: 19-June 07
From: SunnySandyEggo


Hi. You're welcome. Glad we could assist. Good luck with your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    11th December 2019 - 08:33 AM