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 Programming / May 2007

Tip: Looking for answers? Try searching our database.

Open a new form for the same record.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JimH - 13 May 2007 20:02 GMT
Hi All,

My new question is:
I am trying to open a new form from my main form, for the same record I am
editing.

My code is:
DoCmd.OpenForm [PICS], acNormal, "", "[MODELNUMBER]=FORMS![PARTSFORM]!
[MODELNUMBER]"

This code works fine if that [MODELNUMBER] already exists in PICS table.
If I have not entered any data for that Model Number in Pics, the form opens
blank, "No [MODELNUMBER], and I have to manually enter it.

I tried If statement to check for [MODELNUMBER] to see if its Null, and fill
the field, but did not work.

Any ideas to put me in the right direction will be appreciated.

Jim
Ofer Cohen - 13 May 2007 23:43 GMT
Pass the value of MODELNUMBER to the next form using the OpenArgs

DoCmd.OpenForm "PICS", , , "[MODELNUMBER]=FORMS![PARTSFORM]![MODELNUMBER]"
, , , Me.[MODELNUMBER]

On the OnLoad event of the second form write the code

If me.NewRecord And Not IsNull(Me.OpenArgs) Then
  Me.[MODELNUMBER] = Me.OpenArgs
End If
Signature

Good Luck
BS"D

> Hi All,
>
[quoted text clipped - 16 lines]
>
> Jim
 
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.