Need Help on Macro, Really confused 2

A

Athens

Im still confused.

maybe i didnt word it right the first time.

i have a form with a subform for client
in the subform i have two fields (client name, firm name) and then an open
form button is next to the two fields.
The button leads to a form where you enter in the rest of the information
for the client.

myproblem is, when you click on the button, it takes you to the form, but
the form isnt ID specific. I.e. it takes you to the first client in the
client table, not the client you are currently on.

how do i fix this?

i already have the relationships set up correctly.
i just need it to link.
 
B

bhicks11 via AccessMonster.com

I'm a little confused by your setup also Athens. Like, why is the subform
opening the form?

Here's what I suggest to open the form to a particular client ID:

Just make a little form with a combobox - in the datasource for the combobox,
put Table/Query, in the rowsource, click the three little buttons to the
right and make a query that has your client ID, client name and firm name in
it. Sort it on the client name if you like. Click the X to save it and go
back to your little form. Now in the properties of the combobox, select the
format tab, select column count, put 3 in there, in column widths put 0,.5,.5.
Select the Data tab, make the Bound Column 1.

We'll say the form name is LittleFrm and the combobox is Combo1. In the
properties of your main form, select the data tab, in the filter put the name
of your table or query . the ID field = forms!LittleFrm.Combo1.column(0)

This will filter your records to the selection on the LittleFrm. Your user
will see the Client Name and Firm Name but the selection is bound to the ID.

Bonnie
http://www.dataplus-svc.com
 
S

Steve Schapel

Athens,

Look at the design view of the macro. You forgot to mention, but I
assume it uses the OpenForm action. Click to put your cursor in the
line for that action, and thyen look at the Properties. Is there
something entered in the Where Condition argument? This is where you
need to control the record that the second form is opening to.
 
A

Athens

Unfortunately, that didnt work either.
Thanks for all of your help Bonnie.

Im gunna have to think of another way of doing this.
 
A

Athens

Steve,

This is what is written in there: "[GRSLabID]=" & "'" & [GRSLabID] & "'"

I have Access 2007. I made the open form button using the wizard. and the
wizard asks for what the linking item is. So i chose the table linking common
ID for all of my information. I have several tables that are all linked by
that id. even though they might have other primary keys.
 
S

Steve Schapel

Athens,

The syntax of this expression would imply that the GRSLabID field is a
Text data type - is that correct? I would have assumed it is a Number
field of some sort, and if that is the case, change the Where Condition to:
"[GRSLabID]=" & [GRSLabID]
 
A

Athens

No you are correct. It is text.
The ID takes 4 letters and 4 to 5 numbers
i.e. CNDD1001

Steve Schapel said:
Athens,

The syntax of this expression would imply that the GRSLabID field is a
Text data type - is that correct? I would have assumed it is a Number
field of some sort, and if that is the case, change the Where Condition to:
"[GRSLabID]=" & [GRSLabID]

--
Steve Schapel, Microsoft Access MVP
Steve,

This is what is written in there: "[GRSLabID]=" & "'" & [GRSLabID] & "'"

I have Access 2007. I made the open form button using the wizard. and the
wizard asks for what the linking item is. So i chose the table linking common
ID for all of my information. I have several tables that are all linked by
that id. even though they might have other primary keys.
 
A

Athens

But its still not linking the corrct way. Is there any other expression i can
use? Or a filter i can apply to the macro?

Athens said:
No you are correct. It is text.
The ID takes 4 letters and 4 to 5 numbers
i.e. CNDD1001

Steve Schapel said:
Athens,

The syntax of this expression would imply that the GRSLabID field is a
Text data type - is that correct? I would have assumed it is a Number
field of some sort, and if that is the case, change the Where Condition to:
"[GRSLabID]=" & [GRSLabID]

--
Steve Schapel, Microsoft Access MVP
Steve,

This is what is written in there: "[GRSLabID]=" & "'" & [GRSLabID] & "'"

I have Access 2007. I made the open form button using the wizard. and the
wizard asks for what the linking item is. So i chose the table linking common
ID for all of my information. I have several tables that are all linked by
that id. even though they might have other primary keys.
 
S

Steve Schapel

Athens,

The expression also implies that you have a GRSLabID field in the same
place as the button that the macro is on. Is this the case?
 

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