Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Swapping Data Between Forms

Status
Not open for further replies.

LiamOC

Technical User
Sep 12, 2002
9
0
0
IE

Hi,

I have two forms, networkRefurbishment and addASpecialCode. After entering information onto the form addASpecialCode and exitng from this form I need the information contained in a field called newCode to be transferred over to a field called Code in the second form networkRefurbishment.

networkRefurbishment is still open after addASpecialCode is closed, addASpecialCode justs pops up while entering a record in networkRefurbishment.
I use a button to exit from the first form and I have tried the following code in the sub procedure for this button but no luck!

[Forms]![networkRefurbishment]!
Code:
.Requery 
[Forms]![networkRefurbishment]![Code] = [Forms]![addASpecialCode]![newCode] 

When I do this I get the following error:

Runtime '438': 

Object doesn't support this property or method 


Can someone please help me? 

Liam
 
Code:
[Forms]![networkRefurbishment]!.Requery
NO Do not do this. It will cause the current record to go back to the first record

You say the Code and newCode are 'fields' - I assume that you also have controls on the respective forms with the same names ? - If not then you need to add them.

Then the code you need on the cmdClose button is
Code:
Forms!networkRefurbishment!Code = newCode
DoCmd.Close



QED.

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top