Opening the form

M

Maracay

Hi Guys,

I am created a consult form, is linked to a query, but when the form is open
it shows a data already, I would like to have the form empty no data at all
and when the use call the record, shows it, another thing is that I want to
create a cancel command button and what I want to do is clear all data from
the form.

I will appreciate any help
 
T

tom_willpa

high quality Soccer jerseys NBA Jersey tracksuit and jackets, GHD
hairstraightener supplier from www.willpa.com

Are you a Retail businessman who bother by the purchase price? China
Cheapest TOP wholesale website can help you

we are specialize in replica sport goods manufacturing in china, we can
offer you all kinds of soccer jersey, NBA jersey,shoes and so on. they are
the best brand replica goods whih are look the same as the original goods.
excellent quality and steady supply for them. we have been marketed in Europe
and American for 3 year. all the goods we offer are AAA quality. our soccer
jersey are Thailand style. If any goods you buy from my company have problem,
we will refund or resend them again. Most of ourProducts have no minimum
order requirements,soyou can shop retail goods at wholesale prices. if you
can buy more than 300usd. We offer free shipping. The more you buy the more
discount for you.

National soccer jerseys: http://www.willpa.com
Club soccer jerseys: http://www.willpa.com
NBA Jerseys: http://www.willpa.com
T-shirt and shirt: http://www.willpa.com
Tracksuit: http://www.willpa.com
Hoody & Jackets: http://www.willpa.com
UGG boots: http://www.willpa.com
Hair style: http://www.willpa.com
shopping Index: http://www.willpa.com

EMS shipping. 7days arrive, paypal accept

want more information pls contact us or check our website: www.willpa.com
 
J

Jack Leach

If you want the user to only add records but NOT have the ability to go back
and edit them:

Open the form using the DoCmd.OpenForm method. For the Datamode argument,
use DataEntry.



If you want to still be able to navigate to existing records, then you need
to include a line of code in the Form_Open event:

DoCmd.GotoRecord , , acNewRecord


Either of these methods will show "no data" (actually, a blank form being
that you are on a new record).


To provide a Cancel button, use the Me.Undo method behind the code of the
button. This is the equivelant of Ctrl+Z or Esc. Providing the user has not
saved the record yet, all data entered would be erased, leaving a blank form
again.

It may happen that you want to prevent the user from saving until certain
fields are filled in. In this case, use the Before_Update event of the FORM
(not a control), and validate the current entry. Set Cancel=True if you want
to cancel the save:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim bFlag As Boolean
If Isnull(Me.Control1) Then bFlag = True
If Isnull(Me.Control2) Then bFlag = True
If Isnull(Me.Control3) Then bFlag = True
If bFlag = True Then
Cancel = True
MsgBox "Pease fill required data!"
End If
End Sub



hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top