Double click link from a subform/report within a form - Help!

C

CP

I have a form showing "clients" and on that form is a related subreport in
dataview showing "clients jobs"

I have first used a combo box to choose the client I want and listed in the
subreport are the jobs relating to that client

I want to then double click one of the lines in the dataview and that then
take me to another form showing the job I double clicked.
 
M

Mark A. Sam

If you are asking how to use the double click event on the subform, place
the code in the double click event of the textboxes.

God Bless,

Mark A. Sam
 
C

CP

Yes I am - I am a novice at this and this problem is one I cant get over and
I dont know the coding.

Main Form - "Cust"
Sub form - "jobssubform"
Form I wish to open on double click - "jobdata"

So whilst using "cust" to find the customer which shows jobs related to that
customer in "jobssubform" I double click the job no (the unique ref in the
related table) and it should open the form "jobdata" showing the related job
(assuming jobdata uses the same unique ref)

So can you help with the coding please
Thank you in advance

I am sure this is in the help section of the program but I cant type
anything in that brings this information up.
 
M

Mark A. Sam

This is the syntax

If [myUniqueField is a numeric field
DoCmd.OpenForm "jobdata", , , "[myUniqueField] = " & [myUniqueField]

If [myUniqueField is a textfield
DoCmd.OpenForm "jobdata", , , "[myUniqueField] = '" & [myUniqueField] & "'"

If [myUniqueField is a date field
DoCmd.OpenForm "jobdata", , , "[myUniqueField] = #" & [myUniqueField] & "#"

On the left hand side of the = sign, [myUniqueField] is a field name on the
form being opened. On the right it is a textbox or other control name on
the calling form.

Hope the helps you. God Bless,

Mark A. Sam
 
C

CP

Ok that sorted it - thank you very much (been looking for that for months) -
anywhere you can point me (website ect.) for more info on adding things to
this type of coding like closing the original form, running a query prior to
opening the new form and so on??

Mark A. Sam said:
This is the syntax

If [myUniqueField is a numeric field
DoCmd.OpenForm "jobdata", , , "[myUniqueField] = " & [myUniqueField]

If [myUniqueField is a textfield
DoCmd.OpenForm "jobdata", , , "[myUniqueField] = '" & [myUniqueField] & "'"

If [myUniqueField is a date field
DoCmd.OpenForm "jobdata", , , "[myUniqueField] = #" & [myUniqueField] & "#"

On the left hand side of the = sign, [myUniqueField] is a field name on the
form being opened. On the right it is a textbox or other control name on
the calling form.

Hope the helps you. God Bless,

Mark A. Sam



CP said:
Yes I am - I am a novice at this and this problem is one I cant get over
and
I dont know the coding.

Main Form - "Cust"
Sub form - "jobssubform"
Form I wish to open on double click - "jobdata"

So whilst using "cust" to find the customer which shows jobs related to
that
customer in "jobssubform" I double click the job no (the unique ref in the
related table) and it should open the form "jobdata" showing the related
job
(assuming jobdata uses the same unique ref)

So can you help with the coding please
Thank you in advance

I am sure this is in the help section of the program but I cant type
anything in that brings this information up.
 
M

Mark A. Sam

Here is a good site: http://www.mvps.org/access/

I wish I could recommend a good book with just basics for the things like
you described, but they usually have an overabundance of information and it
is difficult at least for me to sift through and get the basics techniques.
You just have to chug along for a while using this forum and after a while
you be able to figure things out. Access has to many different ways to do
things, that it can be confusing as to which ones to use.

Ok that sorted it - thank you very much (been looking for that for
months) -
anywhere you can point me (website ect.) for more info on adding things to
this type of coding like closing the original form, running a query prior
to
opening the new form and so on??

Mark A. Sam said:
This is the syntax

If [myUniqueField is a numeric field
DoCmd.OpenForm "jobdata", , , "[myUniqueField] = " & [myUniqueField]

If [myUniqueField is a textfield
DoCmd.OpenForm "jobdata", , , "[myUniqueField] = '" & [myUniqueField] &
"'"

If [myUniqueField is a date field
DoCmd.OpenForm "jobdata", , , "[myUniqueField] = #" & [myUniqueField] &
"#"

On the left hand side of the = sign, [myUniqueField] is a field name on
the
form being opened. On the right it is a textbox or other control name on
the calling form.

Hope the helps you. God Bless,

Mark A. Sam



CP said:
Yes I am - I am a novice at this and this problem is one I cant get
over
and
I dont know the coding.

Main Form - "Cust"
Sub form - "jobssubform"
Form I wish to open on double click - "jobdata"

So whilst using "cust" to find the customer which shows jobs related to
that
customer in "jobssubform" I double click the job no (the unique ref in
the
related table) and it should open the form "jobdata" showing the
related
job
(assuming jobdata uses the same unique ref)

So can you help with the coding please
Thank you in advance

I am sure this is in the help section of the program but I cant type
anything in that brings this information up.

:

If you are asking how to use the double click event on the subform,
place
the code in the double click event of the textboxes.

God Bless,

Mark A. Sam

I have a form showing "clients" and on that form is a related
subreport
in
dataview showing "clients jobs"

I have first used a combo box to choose the client I want and listed
in
the
subreport are the jobs relating to that client

I want to then double click one of the lines in the dataview and
that
then
take me to another form showing the job I double clicked.
 

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