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 / Forms / September 2005

Tip: Looking for answers? Try searching our database.

Open Form Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom K - 29 Sep 2005 20:47 GMT
Hi,
Im tring to open a form(frmBusiness) from another form (frmAddress). Im using
a command button on the Address form which uses a macro action Open Form. The
data mode is left blank. The Where is set to [AddressID] = [Forms]!
[frmAddress]![AddressID]. The business form Edit and Add properties are set
to No because I dont want to add records or edit directly from the business
form. The problem is that if there is a record for the business it displays
that record, but if there is no record the whole form is displayed blank with
no controls. I want it to open to a new record if there is no current record.

If I set the data mode in the open form action to add or edit it works but it
then allows the user to add and edit records from the business form (it
overrides the forms properties, AllowEdits=No...ect) , which I dont want.

help

Tom
Steve Schapel - 30 Sep 2005 07:15 GMT
Tom,

I am fairly sure I understand what you mean.  How about doing your macro
like this (assumes that the Record Source of the frmAddress form is a
query named Addresses)...

 Condition: DCount("*","Addresses","[AddressID]=" & [AddressID])>0
 Action: OpenForm
    Form Name: frmAddress
    Where Condition: [AddressID]=[Forms]![frmAddress]![AddressID]
 Condition: DCount("*","Addresses","[AddressID]=" & [AddressID])=0
 Action: OpenForm
    Form Name: frmAddress
 Condition: ...
 Action: SetValue
    Item: [Forms]![frmAddress].[AllowAdditions]
    Expression: Yes
 Condition: ...
 Action: GoToRecord
      Record: New

Signature

Steve Schapel, Microsoft Access MVP

> Hi,
> Im tring to open a form(frmBusiness) from another form (frmAddress). Im using
[quoted text clipped - 13 lines]
>
> Tom
 
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.