Listbox (or alternative) Visible if not null

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a form which has a lot of linking to it and I would like to represent
what a particular element is linked to on the form. For example I have record
a in table 1 and it is linked to record b in table 2 and record c in table 3.
When I look at record a in the form I would like seperate list boxes for each
table it may be linked to. I would also like them to be invisible if there
are no records in it.

I can bring the listboxes up o.k and requery them on current, but the IsNull
function is giving me some grief. Is it possible to do this? Is there an
alternative to listboxes?
Cheers,
Ben
 
I use two events so the other list boxes apear and dissapear as soon as you
touch a botton depending on the value of the first list box.

Use nz(textbox,ValueToOutputIfTextboxIsNull) to find null values. This works
better than Is Null. I think list boxes are your best bet for what you want
to do, only other thing I can think of is continous subforms which aren't as
good.

Private Sub lstRecordA_AfterUpdate()
If Nz(lstRecordA, "") > "" Then
lstRecordA.visible = true
Else
lstRecordA.visible = false
End If
End Sub

Private Sub cboFieldToSearch_KeyUp(KeyCode As Integer, Shift As Integer)
If lstRecordA.Text > "" Then
lstRecordB.visible = true
Else
lstRecordB.visible = false
End If
End Sub
 
thanks adam,

is it possible to have this On Current of the form? I would like the lists
to appear/disappear as the user scrolls through records.

thanks!!
 
I would use the list boxes mouse up event:

Private Sub lstRecordA_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
'code
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top