PC Review


Reply
Thread Tools Rate Thread

How do I copy a value from one form to another?

 
 
=?Utf-8?B?S3Jpc3Rh?=
Guest
Posts: n/a
 
      7th Jun 2005
My situation...

I have a form that is created from a query of two tables. Within this form
there is a contactID (foreign key to the contact table), giftID (primary
key), batchID (foreign key to the batch table), and now a tributeID (foreign
key to the tribute table). After entering all the gift information including
associating all the IDs (except tribute), I want to be able to associate a
tribute. I have set the field to be a lookup value. If the value is not
there I created a pop-up box that asks, 'Add a new tribute?' If the answer
is yes, the tribute form opens. I then add a new tribute. My question is,
how can I copy the value of the new tributeID and place it in the tributeID
field on the Gift form? I have tried global variables,etc. with no luck. What
am I missing?

See the code that I have tried below: (This will work within the same form.
It will not work using multiple forms.) Note: I have tried writing -
Form![GiftForm]![txtTributeID.value] = stTribute

Option Compare Database
Public stTribute As String
Private Sub Command12_Click()
DoCmd.Save
stTribute = Me.Tribute_Name
txtTest.Value = stTribute
End Sub


Please Advise...

Thank you.
 
Reply With Quote
 
 
 
 
Lance McGonigal
Guest
Posts: n/a
 
      9th Jun 2005
I think you'll have to fully qualify both object names
(forms!myform!myobject). I'd also put a requery statement on the combobox
so that when the tribute add for is closed the combobox will requery when
they go to select it.

good luck

"Krista" <(E-Mail Removed)> wrote in message
news:0B536EF6-8B5E-405E-9293-(E-Mail Removed)...
> My situation...
>
> I have a form that is created from a query of two tables. Within this

form
> there is a contactID (foreign key to the contact table), giftID (primary
> key), batchID (foreign key to the batch table), and now a tributeID

(foreign
> key to the tribute table). After entering all the gift information

including
> associating all the IDs (except tribute), I want to be able to associate a
> tribute. I have set the field to be a lookup value. If the value is not
> there I created a pop-up box that asks, 'Add a new tribute?' If the

answer
> is yes, the tribute form opens. I then add a new tribute. My question

is,
> how can I copy the value of the new tributeID and place it in the

tributeID
> field on the Gift form? I have tried global variables,etc. with no luck.

What
> am I missing?
>
> See the code that I have tried below: (This will work within the same

form.
> It will not work using multiple forms.) Note: I have tried writing -
> Form![GiftForm]![txtTributeID.value] = stTribute
>
> Option Compare Database
> Public stTribute As String
> Private Sub Command12_Click()
> DoCmd.Save
> stTribute = Me.Tribute_Name
> txtTest.Value = stTribute
> End Sub
>
>
> Please Advise...
>
> Thank you.



 
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
Create a copy of a form and link the entire form to a new datasour forest8 Microsoft Access Forms 1 12th Dec 2009 03:13 AM
Task Form: Unlock/clone/copy first page, or where to get prebuiltcustom form? alexw Microsoft Outlook Form Programming 5 2nd Jul 2008 10:43 PM
Copy Identical Field Values from Form A to Form B? =?Utf-8?B?Um9iZXJ0IFQ=?= Microsoft Access Form Coding 14 23rd Aug 2006 02:21 PM
copy text entered in a form to other location on a form =?Utf-8?B?SHVza3lkdXRjaGJveQ==?= Microsoft Word Document Management 4 27th Jul 2005 12:32 AM
Copy form with subforms, change copy without changing original fo =?Utf-8?B?REpXRg==?= Microsoft Access Forms 1 24th Oct 2004 01:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:40 AM.