Master Control Help Asap

Sorry my aircode was slightly out.

When using the AddNew function it should be

Me.Lst.AddNew (Rs.Fields(0) + ";" + Rs.Fields(1) + ";" + etc)

try now
 
so the complete code should read like this you mean

Code:
Sub ShowUserRosterMultipleUsers()
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim i, j As Long
    Set cn = CurrentProject.Connection
    ' The user roster is exposed as a provider-specific schema rowset
    ' in the Jet 4.0 OLE DB provider.  You have to use a GUID to
    ' reference the schema, as provider-specific schemas are not
    ' listed in ADO's type library for schema rowsets
    Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
    , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
    'Output the list of all users in the current database.
Me.Lst.AddNew (rs.Fields(0) + ";" & rs.Fields(1) + ";" & rs.Fields(2) + ";" rs.Fields(3)
    
While Not rs.EOF
      Me.Lst.AddNew (rs.Fields(0) + ";" + rs.Fields(1) + ";" + rs.Fields(2) + ";" rs.Fields(3)  
    Wend
End Sub
 
because this didnt work the above
 
If you do not want to have field names in your list box then take out the first .AddNew that is outside of the Do While Wend otherwise change the Rs.Fields(0) to read Rs.Fields(0).Name

Ok
 
ok i hav done this but it is still saying systax error hav i maybe created the form wrong after or giving the for the incorrect name ???
 
hate to say it but it is still complaining about systax errors in your two lines u want me to change sorry any other ideas
 
Have created a simple applet that works without errors. As I am the only one logged in it only shows me. You will not be able to test it correctly until you have included this into your current db and deployed it to at least one other user. In that case you should be able to see you and them. I would not be suprised if the name of the user is Admin for more than one user.
 

Attachments

this is perfect jst what i was looking for and works like a charm, brilliant peice of coding mate and i can see where i was going wrong before this makes alot more sence thanks for the help sorry for all the trouble nicely done :)
 
im gunna annoye u now lol, dnt surpose u could create another button for me that refreshes the list so i dnt hav to close and reopen it every time ....

thanks would be a great help works so far
 
All you need to do is to add a further button to the form, give it a meaninful name, like CmdRefresh and on the OnClick Event enter

Code:
Me.List0.Requery


Ok
 
thanks mate really thanks u have saved me alot of trouble
 
I have suddenly realised my last post was incorrect. The requery would not test the function again it would simply refresh the underlying table. So on your OnClick Event of the command button you need to enter

Code:
Call ShowUserRosterMultipleUsers()
 
when i do this is says the macro...

Call ShowUserRosterMultipleUsers()

cannot be found whats this mean and how do i fix it????
 
never mind i was being an idoit when injected straighted into the code file works fine sorry thanks so much mate for all your help :)
 

Users who are viewing this thread

Back
Top Bottom