473,320 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

open Access Form from hyperlink with filter

6
I have tried to search the forum but kept getting blank page so I apologise if this has already been posted somewhere.

I am a GIS officer and we use a mapping software called Exponare Public which is web based and allows non mapping people to view our datasets without being able to change them.

Within this software we can do hyperlinks out. What I would like to do is have a link which opens up a form with all the asset information in it, including photos and maintenance etc.

looking around I have found that the best way probably to do this is write the asset ID out into a command line switch, witch will then open up the database and hopefully write the asset ID in so that the form opens to the correct data.

The command line is;
"\\kangaroo\groups\$Technical Services\Asset Management\$Current AM Documents\Asset Condition Assessments\Buildings Condition Assessments\condition assesment 2007\Gannawarra V3.mdb" /cmd "12"

where i am opening a mdb called gannawarra V3 and trying to pass the asset_ID of 12 into the db.

Within the MDB I have writen a function as follows:

Function CheckCommandLine()
Dim stLinkCriteria As String
stLinkCriteria = Command()
DoCmd.OpenForm "assets", , , "[AssetID] = " & stLinkCriteria
End Function\

I then have an autoexec macro which runs the function.

This is as far as I get as it doesn't seem to be passing the asset id in at all. I have tried variant, string and integer but none of them work. it is crashing at the asset ID = "part with a runtime error '3075' syntax error (missing operator_ in query expression '[AsserID] = '

Not sure where is is wrong, If anyone has done this before and can help out that would be absolutly fantastic, if anyone has any other way to do this that would be apreciated too.

Cheers,

Laura
Dec 8 '08 #1
6 6931
nico5038
3,080 Expert 2GB
Hmm, never used Access with a command line interface, but there's an alternative.
Just create a textfile holding the assetID and link a table to that file.
(This file will have to be filled/overwritten from your application with the correct ID)
Create a query where you JOIN the linked textfile field with the table holding the data.
This query can be used for your form.
Next create the database and set in the startup your form as the first to be displayed.

Now you're able to fill the textfile and start the database to show the value.

Getting the idea ?

Nic;o)
Dec 8 '08 #2
LODIE
6
Thanks Nico, I will give it a go, sounds simple enough.
Dec 8 '08 #3
nico5038
3,080 Expert 2GB
Don't hesitate to post when stuck :-)

Nic;o)
Dec 8 '08 #4
ADezii
8,834 Expert 8TB
@LODIE
Hello Laura!

The following code will Open the Northwind Database in the C:\Test Directory and pass to it the Command Line Argument (/cmd) of "Fuller". Employees is designated as the Start Up Form, and when it opens Code placed in the Open() Event of the Employees Form will create a Filter based on the LastName Field. The Filter will read the value of the Command() Function, create the Filter based on it, then display the appropriate Record, namely [LastName] = 'Fuller'. The code has been tested and is fully operation. Hopefully it will point you in the right direction.
Expand|Select|Wrap|Line Numbers
  1. "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Test\Northwind.mdb" /cmd "Fuller"
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.   Me.Filter = "[LastName] = '" & Command & "'"
  3.   Me.FilterOn = True
  4. End Sub
P.S. - As previously stated by Nico, we are here if you get stuck.
Dec 9 '08 #5
LODIE
6
Thanks Adezii,

I ended up adapting the Northwind solution that you put up. It worked perfectly once I made some adjustments to my start up script so that it would only open up the form if command existed.

However, stupid me was thinking that just because I could get the command to work from a dos prompt it would work no problems from Exponare. Obviously this was not the case. Exponare runs as a web browser, and although I had hotlinked already to excel and word docs, I forgot that they were opening up in Explorer, not in their native programs.

Unfortunately access doesn't do this. So unless I want to convert all my pretty, complicated forms into data access pages and open them over the internet (which always causes security problems with pop ups) I can't do a hyperlink to access from a web browser.

Does anyone have any ideas????

Thanks heaps for your help already, I will use this solution in something just so all the time I wasted isn't actually wasted :)

Cheers,

Laura
Dec 9 '08 #6
ADezii
8,834 Expert 8TB
@LODIE
I think what it basically boils down to is that you cannot pass the /cmd Switch to an Access Database via a Hyperlink, at least to the best of my knowledge. Can Exponare pass a Cookie or Text File to the Client's PC that the Start Up Form can read? (Long Shot, I know!)
Dec 9 '08 #7

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

Similar topics

6
by: John | last post by:
Just a general question... I'm currently using a combobox that when updated, opens a form with its recordset based on a query using the combo box value as the criteria. I'm I correct in...
6
by: dog | last post by:
Does anyone know how to use a hyperlink in MS Access (I'm using 97) to open a report or form within the same database? I have a form in my database, I have put a label on it, some text, and when...
0
by: Bill Thom | last post by:
I have a Microsoft Access 2000 (9.0.4402 SR-1) database that I am attempting to launch from a hyperlink using Internet Explorer (Version 6.0.2800.1106). If I attempt to launch the database from...
5
by: John Warner | last post by:
I have a wierd problem that I can't find any reference to in the knowledge base. I develop simple databases at the company where I work, and many of them are used by hundreds of employees. We all...
12
by: my-wings | last post by:
I'm hoping someone can tell me what I'm missing about how to open a browser and go to a website from a button or a link in Access 2000. I've tried designating a field as "Hyperlink type" and...
9
by: smokeyd | last post by:
hi, can anyone tell me how to open a link in a new browser window in vbscript.net. i am looking to be able to set the properties such as size, menu bar, scroll bar etc. or alternativelly is...
8
by: Arno R | last post by:
Hi all. When I need to search for pictures, I always have too choose thumbnail-view manually. Is it possible to open the common dialog in thumbnail-view programmatically? Example ?? At the...
2
by: patriciashoe | last post by:
Greeting All I have several public variables which I use to build a filter string that I would like to use when I open a form and several associated sub forms. I have set the value of the combo...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.