Referring Form Control in Access Project View

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear All,

I am new to Access Project.
I am trying to move my access database application to access project
connected to SQL Server.

I am rewriting my old query into Access Project View.
Each time I refer a form control in the criteria column of a view, it is
interpreted as a text.

Anybody can help?

Rgds,
Agus Budianto
 
Hi,

Personally I use stored procedures rather than views when converting
queries, and what works for me is using parameters within the stored
procedure. If you have a textbox on your form call First_Name and a
parameter in your stored procedure called @First_Name the value from the
form gets evaluated when the stored procedure is run. Think of stored
procedures in the same way as views, they can be called in the same way and
can produce the same results with a bit flexibility.

Hope it helps.
 
Dear Alex,

Thanks for the reply.

The Next Questions are:
How to attach the stored procedure to a list box.
And How to past the value of the control to the stored procedure

Sorry to bother you with the questions

Rgds,
Agus Budianto
 
Hi,

If your listbox is called

lstMyWork

then lstMyWork.RowSource = 'Sp_List_Letters'

now I have cut and paste a little stored procedure, you will see there is a
parameter called Candidate_ID, I have not passed the parameter because the
calling form has a textbox on it called Candidate_ID, so you don't need in
this example to pass anything on the command line.

Alter Procedure Sp_List_Letters
(
@Candidate_ID numeric
)
As
Select Candidate_Contact_History_ID, Date, Consultant_Initials as 'CI',
Stage, FileName as 'File Name', Description, Notes from
TblCandidate_Contact_History where Candidate_ID=@Candidate_ID order by Date
DESC
return
here is another example
of calling a stored procedure being used to return an ADO recordset

..Open "Sp_Display_Religion_Rules " & Me.Religion_ID.Value,
CurrentProject.Connection, adLockReadOnly

In the above example I am opening a recordset and passing a value to the
stored procedure.

CurrentProject.Connection.Execute "Sp_Religion_SelectShift " &
Me.Religion_ID.Value & ", 'Early'"

In this example I am setting 2 parameters and just executing the stored
procedure

I hope the above helps, if you need any more help post back here.
 
Thanks Alex.
The problem is solved.

See you in the next issue.

Again, Thank you!

Agus Budianto
 

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

Back
Top