PC Review


Reply
Thread Tools Rate Thread

How do I open a specific Access form record by simply clicking on a field in another form record fie

 
 
New Member
tmmogirl's Avatar
Join Date: May 2012
Posts: 6
 
      20th Jul 2012
I am new to Access but have designed a relatively solid database with my limited knowledge. Now I am looking at creating expressions and/or macros that will automate some of the functions that my volunteers & I need.


I have a Minister's Form that includes a field listing the name of the ministry that particular minister represents. We want to click on that Ministry field and have theMinistry Form open to the corresponding ministry record.


Form 1= FrmMinisters
Field 1= ParentMinName or ParentMinID


Form 2= FrmParentMinistries
Field 2=ParentMinName or ParentMinID


ParentMinID is the primary key for Form 2
ParentMinName is the same value on both corresponding records


I know enough to use the "Event on click" section in properties but don't know enough to create the necessary coding instructions. Can anyone assist me in building a code that will do this?


Thanks!
Melissa
 
Reply With Quote
 
 
 
 
New Member
Join Date: Aug 2012
Posts: 2
 
      27th Aug 2012
Create a property inside the Ministry Form along the lines of:

private _MinistryID as Integer ' Or whatever type your ID Field is.

public property MinistryID() as Integer ' Same as private declaration.
get
return _MinistryID
end get
set (value as Integer)
_MinistryID = value
' Run a function here to filter and/or bind data using _MinistryID.
end set
end property

Then inside the OnClick Event of your field in the Ministers Form have something like

dim frm as new MinistryForm
frm.MinistryID = ParentMinID
frm.showdialog{}

Hope this helps
 
Reply With Quote
 
 
 
 
New Member
tmmogirl's Avatar
Join Date: May 2012
Posts: 6
 
      27th Aug 2012
LouisWatson,
Thanks for answering this. I should've taken it down. I actually got an answer similar to yours on another site withiin a couple days of posting.
Sorry to trouble you!
Melissa
 
Reply With Quote
 
New Member
tmmogirl's Avatar
Join Date: May 2012
Posts: 6
 
      27th Aug 2012
The final coding looked like this:
Private Sub ParentMinID_DblClick(Cancel As Integer)
Dim strCriteria As String
strCriteria = "ParentMinID = " & Me.ParentMinID
DoCmd.OpenForm "FrmParentMinistries", WhereCondition:=strCriteria, WindowMode:=acDialog
End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a form field bound to a table equal a calculated fie =?Utf-8?B?QmlsbHNBY2Nlc3M=?= Microsoft Access Forms 1 7th Feb 2006 03:39 PM
How to make a form field bound to a table equal a calculated fie =?Utf-8?B?QmlsbHNBY2Nlc3M=?= Microsoft Access Forms 1 7th Feb 2006 02:03 PM
How does one simply open one form from another ? Barret Bonden Microsoft VB .NET 17 14th Oct 2004 09:02 PM
Assigning the value of a calculated field on a form to a table fie =?Utf-8?B?RWxlYXphcg==?= Microsoft Access Form Coding 1 17th Jun 2004 05:14 AM
Re: Open and Close (save) excel fie from form Joe Black Microsoft Access Form Coding 0 18th May 2004 12:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:33 AM.