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

Welcome Guest ( Log In | Register )

> Listbox without subform    
 
   
alorenzini
post Oct 18 2010, 04:14 PM
Post #1

UtterAccess Guru
Posts: 655
From: South Dakota



Is there a way to have a listbox linked to another table. Without using a subform.

Here is the situation.

I have a detail form based on (tblUnit) on which I have a tab control. One of the pages of the tab control will contain Note information. I have listbox control on this page which needs to have a record source pointed at my tblUnitNotes table. The list box current recordsource is this:

SELECT tblUnitNote.UnitNoteID, tblUnitNote.UnitID, tblUnitNote.NoteDate AS [Note Date], tblUnitNote.Note, tblUnitNote.NoteCategory AS Category
FROM tblUnitNote INNER JOIN tblUnit ON tblUnitNote.UnitID = tblUnit.UnitID;

I thought this would do it but when I change records on my Detail form the Notes list box stays on the same record in the tblUnitNotes. The linking field between the two is UnitID.

Any ideas?
Go to the top of the page
 
+
 
Start new topic
Replies (1 - 3)
projecttoday
post Oct 18 2010, 05:15 PM
Post #2

UtterAccess VIP
Posts: 5,115
From: Dunbar, WV



Add

WHERE tblUnitNotes.UnitID = Forms.formname.UnitID

to the query. Then put Me.listboxname.Requery in the form's on current event.

Robert
Go to the top of the page
 
+
alorenzini
post Oct 18 2010, 05:21 PM
Post #3

UtterAccess Guru
Posts: 655
From: South Dakota



That works! Thanks.
Go to the top of the page
 
+
projecttoday
post Oct 18 2010, 05:39 PM
Post #4

UtterAccess VIP
Posts: 5,115
From: Dunbar, WV



You're welcome.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 12:39 PM