Opening an edit form using linkcriteria

G

Guest

Hi I have a form which displays data as follows:
Country State City Location Population CrimeRate
US IL Chicago LocA 20000 10
US IL Chicago LocB 10000 4
US NY NY City 40000 2.5

The above form is attached to a table with composite primary key as Country,
State, City and Location. These four keys together make a unique row. I need
to come up with an edit form on the onclick event of the country column so
that I can display a row of data in a form and be able to edit population and
crimerate data. Previously I have used strLinkCriteria method to do this
kind of edit form but with one criteria. e.g
strLinkCriteria = "[LineItemID=" & Me![LineItemID]
However in the present case there will be four link criteria. How does one
code this situation. I would appreciate any help on this. Thanks in advance.
 
G

Guest

strLinkCriteria = "[Country]='" & Me![Country] & "' And [State]='" &
Me![State] & "' & And [City]='" & Me![City] & "' And [Location]='" &
Me![Location] & "'"
 
G

Guest

Thanks Bob for your help. I appreciate it. Regards.

boblarson said:
strLinkCriteria = "[Country]='" & Me![Country] & "' And [State]='" &
Me![State] & "' & And [City]='" & Me![City] & "' And [Location]='" &
Me![Location] & "'"

--
Bob Larson
Access World Forums Super Moderator
____________________________________
If my post was helpful to you, please rate the post.


Jack said:
Hi I have a form which displays data as follows:
Country State City Location Population CrimeRate
US IL Chicago LocA 20000 10
US IL Chicago LocB 10000 4
US NY NY City 40000 2.5

The above form is attached to a table with composite primary key as Country,
State, City and Location. These four keys together make a unique row. I need
to come up with an edit form on the onclick event of the country column so
that I can display a row of data in a form and be able to edit population and
crimerate data. Previously I have used strLinkCriteria method to do this
kind of edit form but with one criteria. e.g
strLinkCriteria = "[LineItemID=" & Me![LineItemID]
However in the present case there will be four link criteria. How does one
code this situation. I would appreciate any help on this. Thanks in advance.
 
G

Guest

I just noticed I had a typo in there.

It SHOULD be:

strLinkCriteria = "[Country]='" & Me![Country] & "' And [State]='" &
Me![State] & "' And [City]='" & Me![City] & "' And [Location]='" &
Me![Location] & "'"

--
Bob Larson
Access World Forums Super Moderator
____________________________________
If my post was helpful to you, please rate the post.


Jack said:
Thanks Bob for your help. I appreciate it. Regards.

boblarson said:
strLinkCriteria = "[Country]='" & Me![Country] & "' And [State]='" &
Me![State] & "' & And [City]='" & Me![City] & "' And [Location]='" &
Me![Location] & "'"

--
Bob Larson
Access World Forums Super Moderator
____________________________________
If my post was helpful to you, please rate the post.


Jack said:
Hi I have a form which displays data as follows:
Country State City Location Population CrimeRate
US IL Chicago LocA 20000 10
US IL Chicago LocB 10000 4
US NY NY City 40000 2.5

The above form is attached to a table with composite primary key as Country,
State, City and Location. These four keys together make a unique row. I need
to come up with an edit form on the onclick event of the country column so
that I can display a row of data in a form and be able to edit population and
crimerate data. Previously I have used strLinkCriteria method to do this
kind of edit form but with one criteria. e.g
strLinkCriteria = "[LineItemID=" & Me![LineItemID]
However in the present case there will be four link criteria. How does one
code this situation. I would appreciate any help on this. Thanks in advance.
 

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