Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

Copy information

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PieterZ - 20 Mar 2005 15:23 GMT
I'm trying to create a command button that will copy information in 2 fields
simultaneously from a form to a subform. I found an example in another
database that looks like this:

Private Sub cmdEnter_Click()
[strDescr] = [Forms]![frmEqpt]![strType]
[intICN] = [Forms]![frmEqpt]![intPartNum]
End Sub

If I use this, I get an error "cannot find [frmEqpt]".
If there is a better way to do this, please help.
Signature

Pieter Z

Rick Brandt - 20 Mar 2005 16:42 GMT
> I'm trying to create a command button that will copy information in 2
> fields simultaneously from a form to a subform. I found an example in
[quoted text clipped - 7 lines]
> If I use this, I get an error "cannot find [frmEqpt]".
> If there is a better way to do this, please help.

Where does this button reside?  Is frmEqpt an open form when you run this code?

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

PieterZ - 20 Mar 2005 18:23 GMT
frmEqpt is a subform on the form in which the button is situated.

> > I'm trying to create a command button that will copy information in 2
> > fields simultaneously from a form to a subform. I found an example in
[quoted text clipped - 9 lines]
>
> Where does this button reside?  Is frmEqpt an open form when you run this code?
Rick Brandt - 21 Mar 2005 14:57 GMT
> frmEqpt is a subform on the form in which the button is situated.

Subforms are not technically "Open" which is why your syntax doesn't work.
You need to reference it by going through the parent form and then its
subform control.

Forms!NameOfParentForm!NameOfSubformControl.Form!intPartNum

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.