Connecting Tech Pros Worldwide Help | Site Map

Control on Continuous Form

  #1  
Old August 22nd, 2007, 10:15 PM
ladybug via AccessMonster.com
Guest
 
Posts: n/a
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

  #2  
Old August 23rd, 2007, 01:05 AM
Phil Stanton
Guest
 
Posts: n/a

re: Control on Continuous Form


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...
Quote:
>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
>

  #3  
Old August 23rd, 2007, 05:45 AM
plum.is.caejwp@gmail.com
Guest
 
Posts: n/a

re: Control on Continuous Form


On Aug 23, 7:06 am, "ladybug via AccessMonster.com" <u21071@uwe>
wrote:
Quote:
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...

  #4  
Old August 23rd, 2007, 03:55 PM
ladybug via AccessMonster.com
Guest
 
Posts: n/a

re: Control on Continuous Form


How do I create a subform when the only other data on the main form is an
unbound text field?

Phil Stanton wrote:
Quote:
>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
>
Quote:
>>I have a table that has three fields. First is date, Second is a text
>>field,
>[quoted text clipped - 10 lines]
Quote:
>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

  #5  
Old August 23rd, 2007, 04:35 PM
ladybug via AccessMonster.com
Guest
 
Posts: n/a

re: Control on Continuous Form


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:
Quote:
>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
>
Quote:
>>I have a table that has three fields. First is date, Second is a text
>>field,
>[quoted text clipped - 10 lines]
Quote:
>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

  #6  
Old August 23rd, 2007, 06:15 PM
Phil Stanton
Guest
 
Posts: n/a

re: Control on Continuous Form


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...
Quote:
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:
Quote:
>>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
>>
Quote:
>>>I have a table that has three fields. First is date, Second is a text
>>>field,
>>[quoted text clipped - 10 lines]
Quote:
>>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
>

  #7  
Old August 23rd, 2007, 07:05 PM
ladybug via AccessMonster.com
Guest
 
Posts: n/a

re: Control on Continuous Form


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:
Quote:
>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
>
Quote:
>Ok, please disregard my last posting. I talked before I thought. :)
>>
>[quoted text clipped - 37 lines]
Quote:
Quote:
>>>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

  #8  
Old August 23rd, 2007, 11:45 PM
Phil Stanton
Guest
 
Posts: n/a

re: Control on Continuous Form




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...
Quote:
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:
Quote:
>>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
>>
Quote:
>>Ok, please disregard my last posting. I talked before I thought. :)
>>>
>>[quoted text clipped - 37 lines]
Quote:
>>>>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
>

  #9  
Old August 27th, 2007, 06:45 PM
ladybug via AccessMonster.com
Guest
 
Posts: n/a

re: Control on Continuous Form


THANK YOU!!!!!!!!!!!!!!!!!
Phil Stanton wrote:
Quote:
>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
>
Quote:
>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]
Quote:
Quote:
>>>>>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

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update All Rows on Continuous form Based on Selection in Footer Patrick A answers 9 April 1st, 2008 06:15 PM
Requery on bound combo box causes data to disappear on continuous form Bill answers 1 June 20th, 2006 07:55 PM
Dynamic Highlighting On Continuous Form? PeteCresswell answers 9 November 13th, 2005 10:56 AM
Sum Unbound Control on Continuous Form Footer? Pat answers 3 November 12th, 2005 07:50 PM