Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inputting data from user forms into a table

Status
Not open for further replies.

Taha60

Technical User
Jun 21, 2002
54
CA
Hello....

I am creating a form in access where the user will , by means of a "open" dialogue box, pick a folder and vb code will be used to read in file properties of the different files in the folder/subfolders.... I had 2 questions...

Firstly I wanted to be able to create a Hyperlink to those files since I do have a "hyperlink" field in my table. (these files may not necessarily be MS office files) How would I read in the path for the file and then using that how would I create a hyperlink.?

Secondly I wanted to add this hyperlink and more information that I will be collecting to an Access table... I am not sure how to do this... My first Hunch was to use a insert SQL statement such as....

dim dbs as database
set dbs = CurrentDb
dbs.execute(INSERT INTO tbl_MyTable('hyperlink', filesize...etc..)

Any suggestions will greately be appreicated

Thanks

Taha





Taha
thamiral@uwo.ca
 
Thanks for the response ...

I tried going to the link you posted, however ... I get a 404 error "Page not found" If its not asking for so much ... could you email me the file to thamiral@uwo.ca ... i will check it every 5 mins ...

Additionally ... I wanted to ask ... How would I do this on ACCESS 2k since M$ removed the database object from ACCESS 2k....

Thanks once again Taha
thamiral@uwo.ca
 
replied to email, but reposting here for completeness

The database object isn't removed from Access 2k, just hidden! A2k uses ADO by default instead of DAO from A97. To use DAO in A2k you will need to open a module, choose tools-->references and select the DAO 3.6 reference. Now in the
database you need to make sure that and Database, Recordset, QueryDef, etc objects are defined as DAO objects so:

Dim rs as Recordset becomes Dim rs as DAO.Recordset
Dim db as Database becomes Dim db as DAO.Database

and so on.
I've not got round to using Access 2000 yet, but I can honestly say I'm not looking forward to it!

Ben ----------------------------------
Ben O'Hara
bo104@westyorkshire.pnn.police.uk
----------------------------------
 
Ben,

Can we use that code to go into specific forms of a database? Right now we have a databaes that is sort of a central database that lets us open about 4 databases. We are using links to open up the databases to certain forms... But with this method, we recieve errors (just irritating popups). Could we edit your code to reach specific forms/tables/reports in our databases? If so, how?

-Josh -JPeters
These things take time...
Got a helpful tip for Access Users? Check out and contribute to 'How to Keep Your Databases from becoming Overwhelming!'
thread181-293590
 
Thanks for the tips guys ... I really appreciate it ... Now all I have to do is try to understang the code... something that is going VERY slow... I wonder if any of you could write up a small comments doc. or something that will help me understang all that .... I am new to access and this is nothing like the databases in *nix systems...

Thanks once again Taha
thamiral@uwo.ca
 
Continuing from the previous msg......

I especially needed help with the ME object and the Nz function ... I cant seem to see where these are commming from.... for instance

Private Sub Form_Current()
Me.lblName.Caption = Nz(Me!FileName, "")
End Sub

additionally ... i wanted to ask ... Why is there an OPEN/Save dialouge box in the module section when it can be easily refered to since its a common dialouge box?

Thanks

Taha
thamiral@uwo.ca
 
I use access 97. You can't just call the open dialog from there, you need to access the api to do it.
Not sure if that's changed in later versions.

nz converts nulls to whatever you specify.

Nz(Me!FileName, "") is the same as

iif(isnull(Me!FileName),"",Me!FileName)

B ----------------------------------
Ben O'Hara
bo104@westyorkshire.pnn.police.uk
----------------------------------
 
Thanks Ben.... Really appreaciate the help ... Taha
thamiral@uwo.ca
 
Hello again ..

The way I was gonna invoke the BROWSE common dialogue box was to open the form in design view and use INSERT---> ACTIVEX CONTROL ---> Microsoft common dialogue box. Then you can easily refer to in as a normal VB object. However access 97 / 2k tell me I need the developer's license. I so knew that would happen ... after all its M$. Anyway ... I will try to adopt Ben's code with his permission Of course.

Thanks
Taha
thamiral@uwo.ca
 
Adapt away my friend.

B ----------------------------------
Ben O'Hara
bo104@westyorkshire.pnn.police.uk
----------------------------------
 
Thanks a lot Ben.....

Your Help is greatly Appreciate this...

Thanks Taha
thamiral@uwo.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top