I have a table of data linked to a text file, the text file being in a rather unhelpful format. The linked table in Access looks something like this:-
==================tblSecurityAccess=======================
Directory SecurityGroup Access
XData UsersGrp1 read
XData UsersGrp2 read/write
XData UsersGrp3 full
YData UsersGrp1 read/write
YData UsersGrp3 full
YData UsersGrp4 read/write
YData UsersGrp5 read
ZData UsersGrp1 full
ZData UsersGrp2 read/write
ZData UsersGrp6 read
====================================================
I have a simple form with a combobox and a listbox. The combobox allows the user to choose which directory he/she wishes to look at. This combobox uses a simple SQL query in the combobox's Row Source property.
Using the After Update event of the combobox, I wish to populate the listbox with all the security groups for the chosen directory. (Ideally the listbox would also display the access for each security group).
I am using Access 2000, and am trying to use VBA code of the form:-
Dim db As Database, rst As Recordset, strSQL As String
Set db = CurrentDB
Set rst = db.OpenRecordset
strSQL = "SELECT SecurityGroup FROM tblSecurityAccess WHERE Directory = " _
& cboDirSelect.Value
.
.
.
Unfortunately Access 2000 does not seem to recognise the Database or Recordset keywords!
Any ideas?
==================tblSecurityAccess=======================
Directory SecurityGroup Access
XData UsersGrp1 read
XData UsersGrp2 read/write
XData UsersGrp3 full
YData UsersGrp1 read/write
YData UsersGrp3 full
YData UsersGrp4 read/write
YData UsersGrp5 read
ZData UsersGrp1 full
ZData UsersGrp2 read/write
ZData UsersGrp6 read
====================================================
I have a simple form with a combobox and a listbox. The combobox allows the user to choose which directory he/she wishes to look at. This combobox uses a simple SQL query in the combobox's Row Source property.
Using the After Update event of the combobox, I wish to populate the listbox with all the security groups for the chosen directory. (Ideally the listbox would also display the access for each security group).
I am using Access 2000, and am trying to use VBA code of the form:-
Dim db As Database, rst As Recordset, strSQL As String
Set db = CurrentDB
Set rst = db.OpenRecordset
strSQL = "SELECT SecurityGroup FROM tblSecurityAccess WHERE Directory = " _
& cboDirSelect.Value
.
.
.
Unfortunately Access 2000 does not seem to recognise the Database or Recordset keywords!
Any ideas?