Asked by:
Selections within a List Box

Question
-
I have a Form that consists of a List Box " frm_List" lists out a selection of columns from a Table and a number of Text Boxes from where I can apply a combination of Filters in order to "Drill " down To the records I want to see. When i see the record that I want to view, I click to select it ( the appropriate Row turns negative (white on black)) and open a form "frm_SWProcess" (to show all the fields associated with that particular record) by using the following Code :-
strDocName = "frm_SWProcess": stLinkCriteria = "[ID]=" & Me![List]
DoCmd.OpenForm strDocName, , , stLinkCriteria, 2, , Me![List]
Where Me![List] holds the "ID" of the record i want to view. all that works fine. However, because my table holds number of records associated with the one that I am now displaying in the Form "frm_SWProcess" and I don't want to go back to my "frm_List" to start and hunt around for an associated record, I thought "Easy", just add another List Box to this second Form "frm_SwProcess", populate it via a "Select" statement and away we go.
Did That. I added a List Box to the Form "frm_SWProcess"and Called the List Box "List223" to distinguish it from the one above which works and also shows all the records associated with the one I selected earlier.
This is where I overstepped my extremely limited knowledge because I thought that all I then had to do would be to re-open the Form "frm_SWProcess" by using a slightly modified version of the code above by double clicking on one of the associated records displayed, substituting the "Me![List]" in my first Form with "Me![List223]" in my second form as follows :-
strDocName = "frm_SWProcess": strLinkCriteria = "[ID]=" & Me![List223]
DoCmd.OpenForm stDocName, , , stLinkCriteria, 2, , Me![List]
I was wrong. I noticed that the version in my original Form "frm_List" highlighted a selection when I clicked on it but the version in the second Form "frm_SWProcess" did not. I then Noticed that the Variable "Me_List" in the fist version held the ID of the record I had selected whilst the Variable "Me_List223" only ever returned a Null value.
If you can understand this, any help would be appreciated.
Thanks Ray C
Saturday, June 25, 2016 10:53 PM
All replies
-
Hi Ray. Did you set up the second listbox the same as the first one? Or, is the second listbox set to allow multiple selections?Saturday, June 25, 2016 11:02 PM
-
As far as I can ascertain, The second List Box SHOULD be exactly the same as the first.
Ray C
Saturday, June 25, 2016 11:18 PM -
Does it mean it's not a multi-select listbox?Saturday, June 25, 2016 11:19 PM
-
Here are some screen Clippings of the Properties box for the Text Box "List" and the Text Box "List223"
Saturday, June 25, 2016 11:26 PM -
Sorry, It doesn't look as though the screen Clippings came through but they are exactly the same for the "Data" items.
Ray C
Saturday, June 25, 2016 11:28 PM -
I tell a lie, They aren't quite the same. The property "Inherit Value List" in the "List" was set to No, whilst the same property was set to Yes in "List223". However, I have set them both to No and there is no change in the way they perform.
Ray C
Saturday, June 25, 2016 11:35 PM -
Without seeing what you got, I'm not sure where else to check. Sorry...Sunday, June 26, 2016 2:27 AM
-
Very Strange. The only property that I think you are referring to is the "Multi Select" property which has 3 selections (None, Simple, Extended). In the first List box (the one that works), the property is set to "None" and therefore, using the logic that "if it works in this box, it should work in the other Box (List 223), that is what I had set the set the second List Box (List 223) "Multi Select" property to.
In doing some further testing this morning, I changed the "Multi select" setting from None to Simple in the first (working) list Box. That produced exactly the same situation as I am getting in the second List Box (i.e. Me![List] = Null]). Setting the property to Extended produces the same result, whereas setting it back to None gets the whole thing working again (i.e. Me![List] = [the index number of the record I am selecting]). Moving on to the Second List Box, I get the same result when i set the property to all three states, (None, Simple, Extended. (i.e. Me![List] = Null]).
I must have some other setting incorrectly set somewhere. I even tried copying the whole of the first "List" box and pasting it into the second Form and renaming it "List223" but I get the same results. Could there be anything in the second Form "frm_SWProfile" that is preventing the List Box from Working correctly?
:-( :-(
Ray C
Sunday, June 26, 2016 9:59 AM -
Hi Ray. Glad to hear you're making some progress. However, like I said earlier, it would be easier if we could actually see a copy of your database. Are you able to email me a copy with test data only?Sunday, June 26, 2016 2:29 PM
-
Hi RayC2,
I agree with .theDBguy it is more helpful to see and check it by our way instead of the description you had mentioned above.
I recommend you to share the copy of your demo database with some free website.
so that other members can also able to access it and if they find something issue in that they can also try to suggest you to solve the issue.
if you are not able to upload your db then try to provide the snapshots of the db.
other wise we just have to assume the situation and try to giving the suggestion which are not accurate to solve your issue.
Regards
Deepak
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Monday, June 27, 2016 1:46 AM -
I understand what you are saying. I would need an e-mail address in order to get something to you.
Though I have to say that i feel very nervous about exposing my pathetic attempts at coding Access to the experts. Please accept that my past flirtations with BASIC, lead to me "playing" with Access as a hobby. I have no real coding knowledge and experience, I just use what I have been able to generate from the few paragraphs I read in a book and as I manage to find a way to do something within Access, I then move on to try and achieve something else. The result (you will find) is a part completed and very disjointed but it works for me.
Very grateful for your help. regards Ray C
Tuesday, June 28, 2016 3:53 PM -
Hi RayC2,
so are you able to provide it? the copy of demo database.
you can paste the link here
Regards
Deepak
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Wednesday, June 29, 2016 7:07 AM