A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to sometimes open form to new record?



 
 
Thread Tools Display Modes
  #11  
Old September 20th, 2007, 04:46 PM posted to microsoft.public.access.forms
NKTower
external usenet poster
 
Posts: 95
Default How to sometimes open form to new record?

OK so add filter to the button for "ALL" such that it really isn't ALL level
2 records, it is just all records that match the PK. This will handle that
initial display - the On Current event will keep it in synch for subsequent
moves.

Private Sub Level2Btn_Click()
Dim frmLevel2GoalsHandle As Form

If Not CurrentProject.AllForms("frmLevel2Goals").IsLoaded Then
DoCmd.OpenForm "frmLevel2Goals", acNormal
End If
DoEvents
Set frmLevel2GoalsHandle = Forms![frmLevel2Goals].Form
frmLevel2GoalsHandle.Filter = "( [level2FK] = " & Me.PK & " )"
frmLevel2GoalsHandle.FilterOn = TRUE
End Sub
  #12  
Old September 20th, 2007, 07:02 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 43
Default How to sometimes open form to new record?

On Sep 20, 11:46 am, NKTower
wrote:
OK so add filter to the button for "ALL" such that it really isn't ALL level
2 records, it is just all records that match the PK. This will handle that
initial display - the On Current event will keep it in synch for subsequent
moves.

Private Sub Level2Btn_Click()
Dim frmLevel2GoalsHandle As Form

If Not CurrentProject.AllForms("frmLevel2Goals").IsLoaded Then
DoCmd.OpenForm "frmLevel2Goals", acNormal
End If
DoEvents
Set frmLevel2GoalsHandle = Forms![frmLevel2Goals].Form
frmLevel2GoalsHandle.Filter = "( [level2FK] = " & Me.PK & " )"
frmLevel2GoalsHandle.FilterOn = TRUE
End Sub


That's great. Thanks so much!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.