Group:  Microsoft Access ยป microsoft.public.access.forms
Thread: Blank field force entry

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Blank field force entry
Spencer 15.09.2006 22:49:01
I have three forms:

frmCustomers; frmOrders; sfrmOrder Details

frmCustomers is opened and it has several tabs one of which is for orders
where I have the frmOrders with the subform sfrmOrder Details. On the
frmOrders I have a field labeled ShipDate, and on the subform I have a field
labeled Item. The ship date must be entered before the item so on the Got
Focus event of txtItem I put:

If IsNull(Me.Parent.Controls![ShipDate]) Then
MsgBox "You must enter a ship date"
Me.Parent.Controls![ShipDate].SetFocus
End If

This worked until I closed the form and reopened the main form,
frmCustomers. Before opening the form the message box poped up saying I had
to enter the ship date. How do I keep the message box from appearing until I
go to frmOrders and enter data?

Thanks in advance for your help.


I have a form called frmCustomers. In this form I have several tabs one of
which is for orders. The order form, called frmOrders, has a subform called
sfrmOrder Details. frmOrders requires that a ship date be entered before item
details in the subform can be entered. To prevent entering of data before the
ship date is entered on the Got Focus event on txtItemin the subform,
sfrmOrder Details,
Re: Blank field force entry
"Al Campagna" <anon[ at ]anon.net> 16.09.2006 00:07:39
Spencer,
Try using your code in the OnEnter event of Item.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"Spencer" <Spencer[ at ]discussions.microsoft.com> wrote in message
news:0854CB6F-86D1-4196-AB1F-80EEC9C87224[ at ]microsoft.com...
[Quoted Text]
>I have three forms:
>
> frmCustomers; frmOrders; sfrmOrder Details
>
> frmCustomers is opened and it has several tabs one of which is for orders
> where I have the frmOrders with the subform sfrmOrder Details. On the
> frmOrders I have a field labeled ShipDate, and on the subform I have a field
> labeled Item. The ship date must be entered before the item so on the Got
> Focus event of txtItem I put:
>
> If IsNull(Me.Parent.Controls![ShipDate]) Then
> MsgBox "You must enter a ship date"
> Me.Parent.Controls![ShipDate].SetFocus
> End If
>
> This worked until I closed the form and reopened the main form,
> frmCustomers. Before opening the form the message box poped up saying I had
> to enter the ship date. How do I keep the message box from appearing until I
> go to frmOrders and enter data?
>
> Thanks in advance for your help.
>
>
> I have a form called frmCustomers. In this form I have several tabs one of
> which is for orders. The order form, called frmOrders, has a subform called
> sfrmOrder Details. frmOrders requires that a ship date be entered before item
> details in the subform can be entered. To prevent entering of data before the
> ship date is entered on the Got Focus event on txtItemin the subform,
> sfrmOrder Details,


Re: Blank field force entry
Spencer 16.09.2006 18:30:01
It is still doing the same thing. Plus I have to be able to stop the person
from entering any data before the ship date is entered. Any idea?

"Al Campagna" wrote:

[Quoted Text]
> Spencer,
> Try using your code in the OnEnter event of Item.
> --
> hth
> Al Campagna
> Candia Computer Consulting - Candia NH
> http://home.comcast.net/~cccsolutions
>
> "Spencer" <Spencer[ at ]discussions.microsoft.com> wrote in message
> news:0854CB6F-86D1-4196-AB1F-80EEC9C87224[ at ]microsoft.com...
> >I have three forms:
> >
> > frmCustomers; frmOrders; sfrmOrder Details
> >
> > frmCustomers is opened and it has several tabs one of which is for orders
> > where I have the frmOrders with the subform sfrmOrder Details. On the
> > frmOrders I have a field labeled ShipDate, and on the subform I have a field
> > labeled Item. The ship date must be entered before the item so on the Got
> > Focus event of txtItem I put:
> >
> > If IsNull(Me.Parent.Controls![ShipDate]) Then
> > MsgBox "You must enter a ship date"
> > Me.Parent.Controls![ShipDate].SetFocus
> > End If
> >
> > This worked until I closed the form and reopened the main form,
> > frmCustomers. Before opening the form the message box poped up saying I had
> > to enter the ship date. How do I keep the message box from appearing until I
> > go to frmOrders and enter data?
> >
> > Thanks in advance for your help.
> >
> >
> > I have a form called frmCustomers. In this form I have several tabs one of
> > which is for orders. The order form, called frmOrders, has a subform called
> > sfrmOrder Details. frmOrders requires that a ship date be entered before item
> > details in the subform can be entered. To prevent entering of data before the
> > ship date is entered on the Got Focus event on txtItemin the subform,
> > sfrmOrder Details,
>
>
>
Re: Blank field force entry
"J. Goddard" <jrgoddard[ at ]NO_cyberus_SPAM.ca> 16.09.2006 18:51:51
Check that tab order of the controls of the orders sub-form (In design
view, Click View-Tab order... The order of the controls must be such
that users don't go to the txtItem field first.

The reason is that when you open ftmCustomers, the frmOrders opens too,
and when you open the orders form, the sub-form is automatically opened
too, and if the cursor goes to the txtItem field first, it triggers the
error.

If you cannot change the tab order on the sub-form, a quick fix might be
to put =date() as the default value for shipdate on the orders form.

HTH

John



Spencer wrote:

[Quoted Text]
> It is still doing the same thing. Plus I have to be able to stop the person
> from entering any data before the ship date is entered. Any idea?
>
> "Al Campagna" wrote:
>
>
>>Spencer,
>> Try using your code in the OnEnter event of Item.
>>--
>>hth
>>Al Campagna
>>Candia Computer Consulting - Candia NH
>>http://home.comcast.net/~cccsolutions
>>
>>"Spencer" <Spencer[ at ]discussions.microsoft.com> wrote in message
>>news:0854CB6F-86D1-4196-AB1F-80EEC9C87224[ at ]microsoft.com...
>>
>>>I have three forms:
>>>
>>>frmCustomers; frmOrders; sfrmOrder Details
>>>
>>>frmCustomers is opened and it has several tabs one of which is for orders
>>>where I have the frmOrders with the subform sfrmOrder Details. On the
>>>frmOrders I have a field labeled ShipDate, and on the subform I have a field
>>>labeled Item. The ship date must be entered before the item so on the Got
>>>Focus event of txtItem I put:
>>>
>>>If IsNull(Me.Parent.Controls![ShipDate]) Then
>>>MsgBox "You must enter a ship date"
>>>Me.Parent.Controls![ShipDate].SetFocus
>>>End If
>>>
>>>This worked until I closed the form and reopened the main form,
>>>frmCustomers. Before opening the form the message box poped up saying I had
>>>to enter the ship date. How do I keep the message box from appearing until I
>>>go to frmOrders and enter data?
>>>
>>>Thanks in advance for your help.
>>>
>>>
>>>I have a form called frmCustomers. In this form I have several tabs one of
>>>which is for orders. The order form, called frmOrders, has a subform called
>>>sfrmOrder Details. frmOrders requires that a ship date be entered before item
>>>details in the subform can be entered. To prevent entering of data before the
>>>ship date is entered on the Got Focus event on txtItemin the subform,
>>>sfrmOrder Details,
>>
>>
>>

Re: Blank field force entry
"Al Campagna" <anon[ at ]anon.net> 17.09.2006 04:50:50
Spencer,
That doesn't add up...
Did you remove the code from the GotFocus of Item?
Did you add code similar to this to the Item OnEnter event of Item?

Private Sub Item_Enter()
If IsNull(ShipDate) Then
Beep
MsgBox "Must Enter Ship Date",vbOkOnly, "Missing Data"
DoCmd.GotoControl "ShipDate"
Else
Exit Sub
End If
End Sub

This will work if your setup is as indicated...
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"Spencer" <Spencer[ at ]discussions.microsoft.com> wrote in message
news:8F7BEC74-A130-4BC1-94A2-CCB03E3B25A8[ at ]microsoft.com...
[Quoted Text]
> It is still doing the same thing. Plus I have to be able to stop the person
> from entering any data before the ship date is entered. Any idea?
>
> "Al Campagna" wrote:
>
>> Spencer,
>> Try using your code in the OnEnter event of Item.
>> --
>> hth
>> Al Campagna
>> Candia Computer Consulting - Candia NH
>> http://home.comcast.net/~cccsolutions
>>
>> "Spencer" <Spencer[ at ]discussions.microsoft.com> wrote in message
>> news:0854CB6F-86D1-4196-AB1F-80EEC9C87224[ at ]microsoft.com...
>> >I have three forms:
>> >
>> > frmCustomers; frmOrders; sfrmOrder Details
>> >
>> > frmCustomers is opened and it has several tabs one of which is for orders
>> > where I have the frmOrders with the subform sfrmOrder Details. On the
>> > frmOrders I have a field labeled ShipDate, and on the subform I have a field
>> > labeled Item. The ship date must be entered before the item so on the Got
>> > Focus event of txtItem I put:
>> >
>> > If IsNull(Me.Parent.Controls![ShipDate]) Then
>> > MsgBox "You must enter a ship date"
>> > Me.Parent.Controls![ShipDate].SetFocus
>> > End If
>> >
>> > This worked until I closed the form and reopened the main form,
>> > frmCustomers. Before opening the form the message box poped up saying I had
>> > to enter the ship date. How do I keep the message box from appearing until I
>> > go to frmOrders and enter data?
>> >
>> > Thanks in advance for your help.
>> >
>> >
>> > I have a form called frmCustomers. In this form I have several tabs one of
>> > which is for orders. The order form, called frmOrders, has a subform called
>> > sfrmOrder Details. frmOrders requires that a ship date be entered before item
>> > details in the subform can be entered. To prevent entering of data before the
>> > ship date is entered on the Got Focus event on txtItemin the subform,
>> > sfrmOrder Details,
>>
>>
>>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net