473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

AllowAdditions on subform

I've been fighting with this for hours and can't figure it out. I have a
continuous subform which I don't want the NewRecord line to appear by
default. I have a button on the main form, my desire is to have it change
to allow additions, set focus to the subform and then GotoRecord,, acNewRec.
I can't get the syntax right for the AllowAddtions.

Sub Button_Click()

' Various failed attempts:
Me!MySubform.AllowAdditions = True
Forms!MyForm.AllowAdditions = True
Forms!MainForm.Form!MyForm.AllowAdditions = True
' All of the above fail

' The lines below have the desired effect
Me!MySubform.SetFocus
DoCmd.GoToRecord , , acNewRec

End Sub

I sure hope someone can give me an idea what I am doing wrong, or another
means of accomplishing what I am trying to do.

Randy Harris
Nov 12 '05 #1
3 13803
Me!NameOfSubformControl.Form.AllowAdditions = True
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
www.pcdatasheet.com


"Randy Harris" <ra***@SpamFree.com> wrote in message
news:V_********************@newssvr28.news.prodigy .com...
I've been fighting with this for hours and can't figure it out. I have a
continuous subform which I don't want the NewRecord line to appear by
default. I have a button on the main form, my desire is to have it change
to allow additions, set focus to the subform and then GotoRecord,, acNewRec.
I can't get the syntax right for the AllowAddtions.

Sub Button_Click()

' Various failed attempts:
Me!MySubform.AllowAdditions = True
Forms!MyForm.AllowAdditions = True
Forms!MainForm.Form!MyForm.AllowAdditions = True
' All of the above fail

' The lines below have the desired effect
Me!MySubform.SetFocus
DoCmd.GoToRecord , , acNewRec

End Sub

I sure hope someone can give me an idea what I am doing wrong, or another
means of accomplishing what I am trying to do.

Randy Harris

Nov 12 '05 #2
That's the ticket. Thanks. A lot. I don't suppose you have code that will
restore the hair I pulled out trying to figure this out myself?
"PC Datasheet" <sp**@nospam.com> wrote in message
news:ds*****************@newsread2.news.atl.earthl ink.net...
Me!NameOfSubformControl.Form.AllowAdditions = True
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
www.pcdatasheet.com


"Randy Harris" <ra***@SpamFree.com> wrote in message
news:V_********************@newssvr28.news.prodigy .com...
I've been fighting with this for hours and can't figure it out. I have a
continuous subform which I don't want the NewRecord line to appear by
default. I have a button on the main form, my desire is to have it change to allow additions, set focus to the subform and then GotoRecord,, acNewRec. I can't get the syntax right for the AllowAddtions.

Sub Button_Click()

' Various failed attempts:
Me!MySubform.AllowAdditions = True
Forms!MyForm.AllowAdditions = True
Forms!MainForm.Form!MyForm.AllowAdditions = True
' All of the above fail

' The lines below have the desired effect
Me!MySubform.SetFocus
DoCmd.GoToRecord , , acNewRec

End Sub

I sure hope someone can give me an idea what I am doing wrong, or another means of accomplishing what I am trying to do.

Randy Harris


Nov 12 '05 #3
Dim MyHead As Object
Dim LostHair As Lost Object
Do Until MyHead.NoLongerBald
Me!LostHair.Replace
Loop
MsgBox "Have A Good One!"

HTH
Steve
PC Datasheet
"Randy Harris" <ra***@SpamFree.com> wrote in message
news:7v********************@newssvr28.news.prodigy .com...
That's the ticket. Thanks. A lot. I don't suppose you have code that will
restore the hair I pulled out trying to figure this out myself?
"PC Datasheet" <sp**@nospam.com> wrote in message
news:ds*****************@newsread2.news.atl.earthl ink.net...
Me!NameOfSubformControl.Form.AllowAdditions = True
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
www.pcdatasheet.com


"Randy Harris" <ra***@SpamFree.com> wrote in message
news:V_********************@newssvr28.news.prodigy .com...
I've been fighting with this for hours and can't figure it out. I have a
continuous subform which I don't want the NewRecord line to appear by
default. I have a button on the main form, my desire is to have it change to allow additions, set focus to the subform and then GotoRecord,, acNewRec. I can't get the syntax right for the AllowAddtions.

Sub Button_Click()

' Various failed attempts:
Me!MySubform.AllowAdditions = True
Forms!MyForm.AllowAdditions = True
Forms!MainForm.Form!MyForm.AllowAdditions = True
' All of the above fail

' The lines below have the desired effect
Me!MySubform.SetFocus
DoCmd.GoToRecord , , acNewRec

End Sub

I sure hope someone can give me an idea what I am doing wrong, or another means of accomplishing what I am trying to do.

Randy Harris



Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mary Litten | last post by:
Hi - (This is my very first post) I have gotten to this point of registering to post because I have been spinning my wheels so long, I believe I am all caught up in the weeds. (and mud) I have...
1
by: Tim Marshall | last post by:
Given a bound continuous subform in an unbound main form, a button on the subform sets allowadditions = true and dataentry = true. This works no problem. But a second button on the subform...
1
by: Tim Graichen | last post by:
I have FrmMain that has one subform (SbForm). FrmMain is filled with records from Tbl1. SbForm is filled with records from Tbl2 based on the current selected record in FrmMain from Tbl1. ...
6
by: Tom | last post by:
I have a button on a main form that executes code to write to the subform. The subform's AllowAdditions property is set to false and in the button's code the subform's AllowAdditions property is...
6
by: Bob Quintal | last post by:
Using Access '97. I have a subform, where the .AllowAdditions property is set to false. I have a button labelled 'Add record' that sets this property = true, followed by a DoCmd.gotoRecord...
6
by: tlyczko | last post by:
I am working on an audits database. The main table, Audits, has an AuditID primary key. Another table, 1:1 relationship, ProgramAudits, has AuditID as a foreign key. I have a master/main form...
2
by: Keith Wilby | last post by:
I have a simple form/subform arrangement with a 1:M relationship. I want to limit the number of records at the many end to a maximum of 4 per "main" record - what's the best way? I've tried this...
14
TheSmileyCoder
by: TheSmileyCoder | last post by:
I have a subform "frm_Obs" on my main form "frm_Main" If there is no records, I want the user to be able to add one. If there allready is one, I want the user to be able to change it, but not add...
1
by: Frieda | last post by:
I needed to stop users from accidentally editing fields in several forms and subfoms. I'm not much of a programmer, so using code I found in various forums, I was able to turn off AllowEdits from On...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.