How to pass values from one dap page to another dap page?

A

Andy

Hello Everybody,

I have tried different ways to make this work but unfortunately i cannot
pass values from one dap(data access page) to another dap . I am running a
search page and it gives me columnar results . When i click on any of the
fields in the results page , it should pass tht value to the main page from
where the search page was called.

We are building a small template using DAP and we require this search
feature to work , but unfortunately I didnt find any articles or forums on
this issue .

Waiting for someones reply,

THanks,
Andy
 
K

Ken Snell [MVP]

There are two ways to do this in DAPs:

(1) Write a cookie from the first DAP that provides the filtering data
value. Read the cookie from the second DAP and then do a ServerFilter method
on the second DAP's Recordset (do in the BeforeInitialBind event). See this
MSDN article:
http://msdn.microsoft.com/library/en-us/dnacc2k2/html/odc_PassParam.asp


(2) Use a hyperlink control on the first DAP that has the filtering data
value in its ServerFilter property. The hyperlink control must navigate to
the second DAP. See this MSDN article:
http://msdn.microsoft.com/library/en-us/dnacc2k/html/connectdap.asp


Some other articles that may be useful:
http://msdn.microsoft.com/library/en-us/dnacchbk/html/acsybex_chap10.asp
http://msdn.microsoft.com/library/en-us/dnofftalk/html/office07052001.asp
http://office.microsoft.com/en-us/assistance/CH010713831033.aspx
http://msdn.microsoft.com/library/en-us/dnacc2k2/html/ODC_acc10_DSCOM.asp
 
A

Andy

Thank you Ken for your prompt reply.

Well the methods you have suggested has to do with running "Select" queries
either by using cookies or using hyperlinks.

Wht I am looking for is if there is anyway i can "Insert" a particular value
selected in Search page eg: abc to the Main page's textbox.

Andy
 
K

Ken Snell [MVP]

Is the Search page a modal page? If yes, then you can pass the value
selected back and forth via the command that opens the modal page.

You don't give us much information about your setup, so I cannot offer more
specific suggestions at this time.
--

Ken Snell
<MS ACCESS MVP>
 
A

Andy

No, the search page is regular .html page . And the main page is also regular
..html page , I am calling the search page OnClick event of button control.

I had used it once but I dont know how to pass values back and forth using
the showModal method.

Is this the only way of tackling this problem or is there anything else out
there?

Thanks,
Andy
 
K

Ken Snell [MVP]

See this Knowledge Base article for some info on the ShowModalDialog method
in VBScript:
http://support.microsoft.com/default.aspx?scid=kb;en-us;221590

As I noted earlier, these are the only methods of which I know. I suppose
you might have the "search" form write data to a table in the database via
an ADO recordset query, and then have the first page read the data from that
table via an ADO recordset query, but that is probably more complex than you
need for your purposes.
 
K

Ken Snell [MVP]

Note also that there is a newsgroup
(microsoft.public.access.dataaccess.pages) that is tailored for DAPs, so you
could do a Google search on its archives to see what else you might find.
 
A

Andy

THanks Ken , i got it to work but for only few cases .

It does pass a value from one window to another but wht if the search page
results into multiple records for a particular column, in this situation the
value returned to the main page is "undefined" because the column has
multiple records and so it cannot read all the records or atleast the record
which was selected .

Andy
 
K

Ken Snell [MVP]

You could use the cookie approach to store multiple values that are
delimited by ; character and then break the cookie apart and read each
value. Otherwise, using the write/read from a table might be the only way to
do it.
--

Ken Snell
<MS ACCESS MVP>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top