Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Msg before inserting the data

Author  Topic 

cool_moon
Starting Member

26 Posts

Posted - 2003-07-09 : 13:04:25
Is it posible to add a message box before inserting the data.i have made some forms.What i want now is to put a message box after entering the data in the database,weather the person want to insert another entry or not.I'll be glad if you people can asnwer me soon.take care.

X002548
Not Just a Number

15586 Posts

Posted - 2003-07-09 : 13:20:01
Either code the insert in vb, or use an on change event a prepare a message box.

Are you connected to a sql server backend?

If not, is the form unbound? If it is why?

Where are you storing the data that they enter?



Brett

8-)
Go to Top of Page

cool_moon
Starting Member

26 Posts

Posted - 2003-07-09 : 13:32:30
i m using MS Access in the backend and storing the Data in a Table name Account.The problem i m facing is that.......!!! I have a field name Serial_no(AutoNumber),when i insert a record and press Enter next Form will come with a new SerialNo.i don't want this.What i what is after pressing Enter,there should be a Message for continuing inserting data....Is there any buildin option in Access???

Go to Top of Page

Andy Verity
Starting Member

12 Posts

Posted - 2003-07-15 : 06:21:20
Do you really need to use the in built autonumber. You could hold a seed number in a table and use that to create a new entry each time adding 1 to it. This way if you delete any old ones the gaps will not be removed the next time you compact and repair.

To get around your problem you could set you form not to allow inserts and every time you want to insert a new record do it by executing an sql statement, refreshing the recordsource of the form and going to the new record.

Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2003-07-15 : 15:01:49
I think we are missing something. In Access an auto-number field will increment on each new record regardless of message box or other interference.

I may be off in left field but I think what your looking for would be best accomplished by using a Relational set. The primary would contain Serial_no(Auto number) The secondary would contain all your detail data. By assigning them in form / sub form layout you could simply roll the sub-form to a new (related) record upon completion of the 1st entry Then close the whole form when done. If the form is set to data entry only it will grab a new number upon open.


Jim
Users <> Logic
Go to Top of Page

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2003-07-15 : 16:35:57
Check Access' main menu bar:

Service >> Parameters... >> Keyboard tab

What do you see on 'Enter press behaviour'? Go to... where?
Next field or next record? Think it over.


Just in case:

Private Sub Form_BeforeInsert(Cancel As Integer)
If MsgBox("Really wish to insert new record?", vbYesNo) = vbNo Then
Cancel = 1
End If
End Sub

- Vit
Go to Top of Page
   

- Advertisement -