By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 2,318 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

Link to open a record in a Form

P: 51
Subject: Trying to open up a record in a form called "fmappointment" when clicking on a "looks like hyperlink" text box called "ContactID"

I have made many instances of this in my database but in this case I am having a setup problem and getting the error "insert perameter"
NOTE: when I do insert the record number in the pop up box the correct record does show

What I have
Text Box - "ContactID" on "Datessubform"
Main Form -"Frmcalendar"
Subform - "Datessubform" inserted into "Frmcalendar"

(1) I have made a macro in the text box of "contactId" which I have made to look like a hyperlink on "Datessubform"

(2) In the "click" event I have inserted
[contactID]=[forms]![FrmCalendar]![Datessubform]![contactid]

NOTE: The main form is a calendar "frmcalendar" with 37 subforms "datessubform" that is a continous form with names "SF1 thru SF37"

I have tried many, many variations to make this work with no luck. The closest I can get is to open up the first record in the "fmappointment" not the one I am requesting.

I have tried to give as much information as possible - if more is needed please ask.

Time for me to ask the pros for some advice!

Thanks
Gary
Jan 4 '09 #1
Share this Question
Share on Google+
16 Replies


nico5038
Expert 2.5K+
P: 3,072
Your assignment:
[contactID]=[forms]![FrmCalendar]![Datessubform]![contactid]
should be:
[contactID]=[forms]![FrmCalendar]![Datessubform]!Form![contactid]
when activated in the main form.
Else use:
[contactID]=Me![contactid]

Just check: Forms: Refer to Form and Subform properties and controls
(Many other useful info there :-)

Nic;o)
Jan 4 '09 #2

P: 51
Nic;o)
Thanks for the suggesstions. unfortunately they gave me the same result with a paramenter error.
I will research the link you supplied.
thanks
Gary
Jan 5 '09 #3

nico5038
Expert 2.5K+
P: 3,072
Hmm, the "parameter request" often points to a wrong field name in a query / form's record source. Did you check that ?
Just try to find the field the popup refers to and check or that field is in the table.

Nic;o)
Jan 5 '09 #4

FishVal
Expert 2.5K+
P: 2,653
@GLEberts
Did you "insert" this expression to OnClick property or to event handling code?
Jan 5 '09 #5

P: 51
What I did is:
(1) Used the Wizard Macro builder
(2) Inserted the Macro into the "OnClick" for CONTACTID
(3) Used open form for the action
(4) in the where condition inserted contactID]=[forms]![FrmCalendar]![Datessubform]![contactid]


Some other information:
I am running the form off a query not a table

2nd Part
I have double checked the pop up which is "Enter Parameter Value" which in this case refers to the "contactId" when I do insert the contactid that I want the correct record comes up.
I have gone through the query,table and form - had no luck coming across any mispelled words or wrong inputs.

Thanks
Gary
Jan 5 '09 #6

nico5038
Expert 2.5K+
P: 3,072
As stated before, the condition should be:
[contactID]=[forms]![FrmCalendar]![Datessubform]!Form![contactid]

When this doesn't work, can you take a screen shot of the "param" message and attach that here?

Nic;o)
Jan 5 '09 #7

P: 51
I have attached a copy of the screen when the pop up comes up.
Thanks for reviewing it.
Gary
Attached Images
File Type: bmp CalendarError.bmp (23.3 KB, 239 views)
Jan 6 '09 #8

nico5038
Expert 2.5K+
P: 3,072
I'm interested in the exact message text, so just the popup will do.
This is too small to read :-)

Nic;o)
Jan 6 '09 #9

P: 51
the pop up says

Enter Parameter Value
forms!frmcalendar!datessubform!form!contactId

Gary
Jan 7 '09 #10

FishVal
Expert 2.5K+
P: 2,653
@GLEberts
Does it mean form having name [datessubform] is embedded in 37 Subform controls having names "SF1 thru SF37"?
Jan 7 '09 #11

P: 51
yes that is correct.

Reference: I am using the shell of the calendar on the thread:

"Ms Access Calendar"
MyWaterloo

Thanks for your help!
Gary
Jan 7 '09 #12

FishVal
Expert 2.5K+
P: 2,653
So, you should use Subform control name in your reference instead fo form name.
for example
[forms]![FrmCalendar]![SF1]!Form![contactid]
instead of
[forms]![FrmCalendar]![Datessubform]!Form![contactid]
Jan 7 '09 #13

P: 51
I noticed that you did not use brackets around "Form"
[forms]![FrmCalendar]![SF1]!Form![contactid]

when I input that and then save - it automatically puts brackets around [form]

then gives me the "Enter Parameter Value" with
[forms]![frmcalendar]![SF1]![Form]![ContactID]

I have tried that variation along with others with no success

Below is the closest thing I can use that does not bring up the "Enter Paramenter Value" pop up box.

however it takes me to the first record in the table - not the one that I am clicking on.

[contactid]=[Forms]![FrmCalendar]![SF1].[Form].[contactid]

after researching the "enter paramenter value" pop up it seems that it comes back to the same thing - table, query or form value.

I have gone back through everything over and over again and can not find anything wrong with any imputs of names in any of the above.

I am using this feature to click on a text box and open up a form with the record in a few other places in the database with no issues. Even searching the same table "tblappointments".

seems that I am missing something very simple and can't grasp it.

frustrated
Gary
Jan 7 '09 #14

nico5038
Expert 2.5K+
P: 3,072
I should start with warning you that you're trying to rebuild Outlook and that I personally would use Outlook and interface my Access .mdb with automation.

One solution is to drop your macro and use VBA instead.
Just code in the OnClick event of the field contactid on the Datessubform:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.Openform "fmappointment",,,"[contactid]="& Me.contactid
  2.  
Nic;o)
Jan 7 '09 #15

P: 51
Thanks for the suggestion and recommendation.
I tired to work the VB first with the wrong code - I have only had 1 night course and still very much a novice. I then went to the Macro thinking it was easier to build.
your solution worked like a charm.

I like your recommendation about the automation I am going to spend some time researching it - sounds like probably the way to go.

I was reading the line below - seems to have the info but if you have others that you think would be a good learning and research tool I would appreciate any feedback.

Using Automation in Microsoft Office Access 2003 to Work with Microsoft Office Outlook 2003

thanks for your help.
Gary
Jan 7 '09 #16

nico5038
Expert 2.5K+
P: 3,072
This is indeed a good start, but also almost every "In depth" Access VBA book will handle automation. With my A2000 came also a programmers guide with much valuable information on the subject.

Glad I could help and much success with your application !

Nic;o)
Jan 7 '09 #17

Post your reply

Sign in to post your reply or Sign up for a free account.