A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Open form to a specific record



 
 
Thread Tools Display Modes
  #1  
Old January 16th, 2009, 01:34 PM posted to microsoft.public.access.gettingstarted
CJ-Hewitt[_2_]
external usenet poster
 
Posts: 8
Default Open form to a specific record

I have two forms that I am working with

One called Edit Equipment and a second called MC Equip List.

The first form is a general view of a piece of heavy equipment which houses
a subform displaying all the equipment attached to it (based off of MC Equip
list)

In the subform, I have it displaying it as follows...

EQ Type --- Description --- Control Button

EQ Type --- Description --- Control Button

EQ Type --- Description --- Control Button

For each piece of equipment that is attached to the machine. The hope was
to click this button, open the MC Equip List form and jump to the record for
a more detailed look at the attached equipment, and eventually
order/repair/replace that item.

I used the control button wizard and matched the two fields that were
supposed to match,
"[Eq Type]=" & "'" & [EType] & "'"
however when I click this button a pop-up asks me to enter a parameter value.

What am I doing wrong?




  #2  
Old January 16th, 2009, 04:36 PM posted to microsoft.public.access.gettingstarted
Albert D. Kallal
external usenet poster
 
Posts: 2,874
Default Open form to a specific record

"CJ-Hewitt" wrote in message
...


I used the control button wizard and matched the two fields that were
supposed to match,
"[Eq Type]=" & "'" & [EType] & "'"
however when I click this button a pop-up asks me to enter a parameter
value.


Place the follwoign code behind the buttion:

docmd.Openform "MC Equip List form",,,"id = " & me!id

Now, replace "id" with the name of the primary key field used for that
sub-form table. It is possible that primary key field is EType, but are you
sure?

If yes, then go:

docmd.Openform "MC Equip List form",,,"Etype = " & me!Etype

If Etype is a string type field (text type), then you have to place quotes
around the field like:

docmd.Openform "MC Equip List form",,,"Etype = '" & me!Etype & "'"

One more thing. if you allow editing in this sub-form, then you really
should write any edits to disk BEFORE you launch the one details form.

So, before the above openform command, go:

if me.Dirty = true then
me.Dirty = false
end if

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada



  #3  
Old January 16th, 2009, 04:55 PM posted to microsoft.public.access.gettingstarted
CJ-Hewitt[_2_]
external usenet poster
 
Posts: 8
Default Open form to a specific record

I'll do that, thanks a bunch!
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.