By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

Updating data in a Hyperlink or OLE type field.

P: 1
Hi,

I'm using MS Access 2002 SP3 & Visual Basic 6.3 on WinXP Home SP2.

I have a table of condition data (5990 records) that relates to information stored in a proprietary application. The primary key in my table (MyKey) is the same as the key used to find data in the other windows application (C:\Folder\My.exe). So, if I am looking at a record in my table, say with ID = 100, I can view further information and images etc in my application by running:
Expand|Select|Wrap|Line Numbers
  1. C:\Folder\My.exe -i 100
Now going through lots of data manually like this would be painful, even if I only have to type in the ID each time. What I have been trying to do is put the information in either a Hyperlink or OLE field, so that I can click in the field and my other application will automatically be launched showing the right data.

I can't seem to do this with the Hyperlink field type, as it wont allow the command line parameter (-i 100). Hyperlink will only work to launch the application alone (no parameters).

I can do it perfectly using the OLE field type, inserting a link the the exe file as an 'Package' object, then editing this (right click, Package Object, Edit Package) using the Object Packager pop up window. In the Object Packager I do menu option Edit, Command Line and put in the full "C:\Folder\My.exe -i 100". Then I do File, Update and quit the Object Packager. Now my field displays "Package" and when I double click it, my application is loaded and shows ID 100 perfectly.

Now, how can I use an update query or even a VB script to run though the whole table and build these "Command Line" options in the OLE link field?

Any suggestions?

Thanks in advance, Rishi.
Dec 12 '07 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,276
Try :
Expand|Select|Wrap|Line Numbers
  1. Dim strCmd As String
  2.  
  3. strCmd = "C:\Folder\My.exe -i " & Me.ControlName
  4. Call Shell(PathName:=strCmd, WindowStyle:=vbNormalFocus)
This assumes the value of the item you want is in a control on your form called ControlName. Obviously change to suit your own details.
Dec 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.