473,419 Members | 1,662 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,419 software developers and data experts.

Control on Continuous Form

I have a table that has three fields. First is date, Second is a text field,
the third is a number.

I want to create a form where the date is entered at the top and then the
text field and number field is a continuous form below. I want to be able to
enter in numerous entries under that date without having to enter the date
each time. Can someone help me through the steps in setting this up?

I had the date in the header and then the text and number field in the detail
set to continuous. However, when I enter in the date and then enter the
other two fields when I hit tab it clears out the date.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200708/1

Aug 22 '07 #1
8 1951
On the main form have an unbound textbox called DateEnter

On the Subform have the DateField called say DateEvent

Then you need this bit of code on the BeforeInsert Event on the subform.
(You might consider setting the DefautValue of DateEvent = Date() to set
today's date)

Option Compare Database
Option Explicit

Private Sub Form_BeforeInsert(Cancel As Integer)

If IsNull(DateEvent) Then
If Not IsDate(Me.Parent!DateEnter) Then
MsgBox "There is no date on the top of the form", vbInformation
Cancel = True
Exit Sub
Else
DateEvent = Me.Parent!DateEnter
End If
End If

End Sub

HTH

Phil

"ladybug via AccessMonster.com" <u21071@uwewrote in message
news:7717a95b5de31@uwe...
>I have a table that has three fields. First is date, Second is a text
field,
the third is a number.

I want to create a form where the date is entered at the top and then the
text field and number field is a continuous form below. I want to be able
to
enter in numerous entries under that date without having to enter the date
each time. Can someone help me through the steps in setting this up?

I had the date in the header and then the text and number field in the
detail
set to continuous. However, when I enter in the date and then enter the
other two fields when I hit tab it clears out the date.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200708/1

Aug 23 '07 #2
On Aug 23, 7:06 am, "ladybug via AccessMonster.com" <u21071@uwe>
wrote:
I have a table that has three fields. First is date, Second is a text field,
the third is a number.

I want to create a form where the date is entered at the top and then the
text field and number field is a continuous form below. I want to be able to
enter in numerous entries under that date without having to enter the date
each time. Can someone help me through the steps in setting this up?

I had the date in the header and then the text and number field in the detail
set to continuous. However, when I enter in the date and then enter the
other two fields when I hit tab it clears out the date.

--
Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/2007...

Aug 23 '07 #3
How do I create a subform when the only other data on the main form is an
unbound text field?

Phil Stanton wrote:
>On the main form have an unbound textbox called DateEnter

On the Subform have the DateField called say DateEvent

Then you need this bit of code on the BeforeInsert Event on the subform.
(You might consider setting the DefautValue of DateEvent = Date() to set
today's date)

Option Compare Database
Option Explicit

Private Sub Form_BeforeInsert(Cancel As Integer)

If IsNull(DateEvent) Then
If Not IsDate(Me.Parent!DateEnter) Then
MsgBox "There is no date on the top of the form", vbInformation
Cancel = True
Exit Sub
Else
DateEvent = Me.Parent!DateEnter
End If
End If

End Sub

HTH

Phil
>>I have a table that has three fields. First is date, Second is a text
field,
[quoted text clipped - 10 lines]
>set to continuous. However, when I enter in the date and then enter the
other two fields when I hit tab it clears out the date.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200708/1

Aug 23 '07 #4
Ok, please disregard my last posting. I talked before I thought. :)

I did what you said and now I am getting this error:
The expression BeforeInsert you entered as the event property setting
produced the following error: Ambiguous name detected: Form_BeforeInsert.

Phil Stanton wrote:
>On the main form have an unbound textbox called DateEnter

On the Subform have the DateField called say DateEvent

Then you need this bit of code on the BeforeInsert Event on the subform.
(You might consider setting the DefautValue of DateEvent = Date() to set
today's date)

Option Compare Database
Option Explicit

Private Sub Form_BeforeInsert(Cancel As Integer)

If IsNull(DateEvent) Then
If Not IsDate(Me.Parent!DateEnter) Then
MsgBox "There is no date on the top of the form", vbInformation
Cancel = True
Exit Sub
Else
DateEvent = Me.Parent!DateEnter
End If
End If

End Sub

HTH

Phil
>>I have a table that has three fields. First is date, Second is a text
field,
[quoted text clipped - 10 lines]
>set to continuous. However, when I enter in the date and then enter the
other two fields when I hit tab it clears out the date.
--
Message posted via http://www.accessmonster.com

Aug 23 '07 #5
Odd.

The BeforInsert shoul only be on the subform. There should be no code on the
main form

Can you select ALL the code on the subform, copy it into your reply and post
it to the NewsGroup I guess there may be a difference in the names of the
controls

Phil
"ladybug via AccessMonster.com" <u21071@uwewrote in message
news:7721524c3d967@uwe...
Ok, please disregard my last posting. I talked before I thought. :)

I did what you said and now I am getting this error:
The expression BeforeInsert you entered as the event property setting
produced the following error: Ambiguous name detected: Form_BeforeInsert.

Phil Stanton wrote:
>>On the main form have an unbound textbox called DateEnter

On the Subform have the DateField called say DateEvent

Then you need this bit of code on the BeforeInsert Event on the subform.
(You might consider setting the DefautValue of DateEvent = Date() to set
today's date)

Option Compare Database
Option Explicit

Private Sub Form_BeforeInsert(Cancel As Integer)

If IsNull(DateEvent) Then
If Not IsDate(Me.Parent!DateEnter) Then
MsgBox "There is no date on the top of the form",
vbInformation
Cancel = True
Exit Sub
Else
DateEvent = Me.Parent!DateEnter
End If
End If

End Sub

HTH

Phil
>>>I have a table that has three fields. First is date, Second is a text
field,
[quoted text clipped - 10 lines]
>>set to continuous. However, when I enter in the date and then enter the
other two fields when I hit tab it clears out the date.

--
Message posted via http://www.accessmonster.com

Aug 23 '07 #6
The only code I have in the subform is what you gave me:
Private Sub Form_BeforeInsert(Cancel As Integer)
Option Compare Database
Option Explicit

Private Sub Form_BeforeInsert(Cancel As Integer)

If IsNull(DateEvent) Then
If Not IsDate(Me.Parent!DateEnter) Then
MsgBox "There is no date on the top of the form", vbInformation
Cancel = True
Exit Sub
Else
DateEvent = Me.Parent!DateEnter
End If
End If

End Sub

Phil Stanton wrote:
>Odd.

The BeforInsert shoul only be on the subform. There should be no code on the
main form

Can you select ALL the code on the subform, copy it into your reply and post
it to the NewsGroup I guess there may be a difference in the names of the
controls

Phil
>Ok, please disregard my last posting. I talked before I thought. :)
[quoted text clipped - 37 lines]
>>>set to continuous. However, when I enter in the date and then enter the
other two fields when I hit tab it clears out the date.
--
Message posted via http://www.accessmonster.com

Aug 23 '07 #7


OK The problem is the very first line. Delete it, it occurs twice and is in
the wrong place. The first line should be

Option Compare Database

In fact the first lines ov erery module should (always) be
Option Compare Database
Option Explicit

Phil

"ladybug via AccessMonster.com" <u21071@uwewrote in message
news:7722a31a30771@uwe...
The only code I have in the subform is what you gave me:
Private Sub Form_BeforeInsert(Cancel As Integer)
Option Compare Database
Option Explicit

Private Sub Form_BeforeInsert(Cancel As Integer)

If IsNull(DateEvent) Then
If Not IsDate(Me.Parent!DateEnter) Then
MsgBox "There is no date on the top of the form", vbInformation
Cancel = True
Exit Sub
Else
DateEvent = Me.Parent!DateEnter
End If
End If

End Sub

Phil Stanton wrote:
>>Odd.

The BeforInsert shoul only be on the subform. There should be no code on
the
main form

Can you select ALL the code on the subform, copy it into your reply and
post
it to the NewsGroup I guess there may be a difference in the names of the
controls

Phil
>>Ok, please disregard my last posting. I talked before I thought. :)
[quoted text clipped - 37 lines]
>>>>set to continuous. However, when I enter in the date and then enter
the
other two fields when I hit tab it clears out the date.

--
Message posted via http://www.accessmonster.com

Aug 23 '07 #8
THANK YOU!!!!!!!!!!!!!!!!!
Phil Stanton wrote:
>OK The problem is the very first line. Delete it, it occurs twice and is in
the wrong place. The first line should be

Option Compare Database

In fact the first lines ov erery module should (always) be
Option Compare Database
Option Explicit

Phil
>The only code I have in the subform is what you gave me:
Private Sub Form_BeforeInsert(Cancel As Integer)
[quoted text clipped - 34 lines]
>>>>>the
>other two fields when I hit tab it clears out the date.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200708/1

Aug 27 '07 #9

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

Similar topics

2
by: John Hargrove | last post by:
I'm having trouble setting decimal place values in the results field of a sample management database I'm building for an environmental testing laboratory. The degree of sensitivity varies among...
3
by: Pat | last post by:
Hello, I've used Sum() to total bound fields on a continuous form with no problem. However, I now have a continuous form, on which I use an unbound field to calculate the number of hours between...
1
by: Roger | last post by:
I've got a continuous form based on a query the first 2 controls on the form are bound to columns in the query a third control (paymentAmount) is unbound I have a total control in the footer,...
9
by: Jack | last post by:
In the control source of a textbox, is there a way to refer to a column of a combobox? For example: =.Column(2) Thanks, Jack
14
by: Mark | last post by:
How can the instances of a textbox control on an continuous form be addressd? Can a specific instance be addressed? For example, a continuous form has ten records. How can the textbox for the...
3
by: DavidB | last post by:
I have a Snapshot Control in a continuous form and I want the source for the control to be different for each instance of the continuous data (based on one of the fields in the recrod source for...
1
by: jodyblau | last post by:
I have a form that is in Continuous form. In each record there is a button next to the a date box. When the button is pushed, the calendar control is set to visible (rather than in a seperate pop...
2
by: Steve | last post by:
I have a continuous form showing Product Code and Product Name. Product Code is five digits and is sequential. I have a textbox in the form header. What is the code to scroll the continuous form so...
5
kcdoell
by: kcdoell | last post by:
Hello: I thought I was done with this one but a user who is testing my DB just pointed out a problem. I used the following in the afterupdate event: Private Sub...
3
by: AdamOnAccess | last post by:
This is something I've always had trouble with, and it comes up fairly frequently... I have a continous form with a single text field and next to this text field, I have a caption that maintains...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.