PC Review


Reply
Thread Tools Rate Thread

Create a form specific to field on the form

 
 
Ravi
Guest
Posts: n/a
 
      19th Apr 2009
I have to create a note field, which should be tied to the one record on the
form. In other words, ever record will have commend button and clicking on it
should open a form specific to that record.
Your help is much appreciated.
 
Reply With Quote
 
 
 
 
boblarson
Guest
Posts: n/a
 
      19th Apr 2009
You should be able to have the form open by using something like this:

DoCmd.OpenForm "YourFormNameHere", , , "[YourKeyFieldNameHere]= " &
Me!YourKeyFieldNameHere
--
Bob Larson
Free MS Access Tutorials and Samples at http://www.btabdevelopment.com

__________________________________


"Ravi" wrote:

> I have to create a note field, which should be tied to the one record on the
> form. In other words, ever record will have commend button and clicking on it
> should open a form specific to that record.
> Your help is much appreciated.

 
Reply With Quote
 
boblarson
Guest
Posts: n/a
 
      19th Apr 2009
You should be able to have the form open by using something like this:

DoCmd.OpenForm "YourFormNameHere", , , "[YourKeyFieldNameHere]= " &
Me!YourKeyFieldNameHere
--
Bob Larson
Free MS Access Tutorials and Samples at http://www.btabdevelopment.com

__________________________________


"Ravi" wrote:

> I have to create a note field, which should be tied to the one record on the
> form. In other words, ever record will have commend button and clicking on it
> should open a form specific to that record.
> Your help is much appreciated.

 
Reply With Quote
 
Ken Sheridan
Guest
Posts: n/a
 
      19th Apr 2009
You have a choice of either including a memo field in the same table to which
the form is bound, or in a separate table related one-to-one to the current
table. The latter has the advantage that, in the event of the separate table
containing the memo field becoming corrupted the existing table is unaffected.

If you do use a separate table then give it a foreign key column which
references the primary key of the existing table, but in the new table also
designate this column as the primary key. Note that the column in the new
table must not be an autonumber. When you create a relationship between the
tables it will then be a one-to-one relationship.

If you put the memo field in the existing table then create a new form bound
to the existing table, but include only a text box control bound to the memo
field in the new form. If you out the memo field in a separate table then do
the same, but bind the form to the new table. In either case set the new
form's AllowAdditions and AllowDeletions properties to False (No).

Whichever way you do it open the new form from a button on your current form
with code along these lines:

Const conFORM = "frmNotes"
Dim strCriteria As String

strCriteria = "[MyID] = " & Me.[MyID]

' ensure current record is saved
Me.Dirty = False
' open Notes form in dialogue mode
DoCmd.OpenForm conFORM, _
WhereCondition:=strCriteria, _
WindowMode:=acDialog

where MyID is the primary key of the existing form's table and of the
separate Notes table if you've created one, and frmNotes is the name of the
new form. I've assumed that MyID is a number data type. If it’s a text data
type amend the code to:

strCriteria = "[MyID] = """ & Me.[MyID] & """"

Ken Sheridan
Stafford, England

"Ravi" wrote:

> I have to create a note field, which should be tied to the one record on the
> form. In other words, ever record will have commend button and clicking on it
> should open a form specific to that record.
> Your help is much appreciated.


 
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 do you create a form with a header which has a form field in i epetersen Microsoft Word Document Management 2 20th May 2010 05:00 AM
Posting to specific form field with C# Dan Microsoft ASP .NET 0 16th Oct 2008 05:51 AM
Opening a form to a specific Record based on a field in the form angelinarose Microsoft Access Form Coding 1 24th Sep 2007 06:44 PM
If I create a form with the wizard and later decide I need to add another field do I have to re-create the form? Mister John Doe Microsoft Access Forms 3 2nd Jan 2005 06:17 AM
How to create a form control over a specific cell Valerio Microsoft Excel Programming 1 10th May 2004 01:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:19 PM.