Add to a bound listbox

  • Thread starter Thread starter Antonio
  • Start date Start date
A

Antonio

What I am trying to do is:

when a user enters an IP address in a text box and clicks
on Add, I want that IP address to be entered into a
listbox.

this is the code I have, but I don't want to use the
RowSource, since the IP addresses are assigned to
customers:

If Len(Me!List1.RowSource) > 0 Then
Me!List1.RowSource = Me!List1.RowSource & ";" & Me!Text1
Else: Me!List1.RowSource = Me!Text1
End If
 
this is the code I have, but I don't want to use the
RowSource, since the IP addresses are assigned to
customers:

ummm... and why would this be a problem?

You should be able to set the Rowsource to a query selecting distinct
IP addresses from the customer table. That way no code is needed, and
you won't risk exceeding the relatively limited number of values
allowed in a List of Values rowsource.
 
It would be a problem because I have customers that exceed
400 IP ranges. Also, I have to be able to delete a range
when a customer changes IPs.

Thanks
 
Back
Top