Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Help with Access/VB
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 30 July 2003 :  08:41:20  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
I am currently workin on forms in MS Access.
Here's my question:

I have created a form that adds a record to a table.
Now I need a button that restores all form fields when clicked.
Here's the code I use now:

Private Sub resetform_Click()
    DoCmd.Restore
Exit_resetform_Click:
    Exit Sub

Err_resetform_Click:
    MsgBox Err.Description
    Resume Exit_resetform_Click
End Sub


The red code does not what I wanted, it somehow resizes the form window...

Any help appreciated!

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 30 July 2003 :  09:18:00  Show Profile
By restore, do you mean blank out all the fields ... i.e. set them to what they would be if you opened the form again?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 30 July 2003 :  09:24:53  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
Yes, like a reset button of a html form.

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 30 July 2003 :  09:34:49  Show Profile
Are you inserting the new record when a button is clicked? By default a form will automatically insert and update records when you start typing unless you program the form otherwise. So, if you haven't programmed it to update after the fact then a reset button won't work, unless you store the "old" values in the form somehow.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 30 July 2003 :  09:37:28  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
Yeah, the new record is inserted when a button is clicked, no data is inserted unless the button is clicked.
(on data submission via the button click the form resets)
Another button ends the form.
And the last one should reset the form...

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 30 July 2003 :  09:42:51  Show Profile
so can't you just look at the code for the data submission and use the part that "resets" the form?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 30 July 2003 :  09:51:34  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
Private Sub eintragen_Click()
On Error GoTo Err_Befehl36_Click

    DoCmd.GoToRecord , , acNewRec

Exit_eintragen_Click:
    Exit Sub

Err_eintragen_Click:
    MsgBox Err.Description
    Resume Exit_Befehl36_Click
    
End Sub


That's the code that inserts the new record.
I just thought there was another DoCmd.??? command to achieve this the easy way.
I'm lost

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 31 July 2003 :  08:24:34  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
While I have solved the problem above (I no longer need that button) I have another question:

Again, I have created a form (no auto-form).+
On clicking the submit button, the values are checked (and or changed).
Now how do I insert those values into a table?


My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 31 July 2003 :  08:46:02  Show Profile
you can do some sql stuff in the page code. look up opening recordset in the help section when you are in the vba editor. it should have some examples. it's similar to what you would do on an asp page.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 31 July 2003 :  18:31:09  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
Got sorted it out... thanks!

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.36 seconds. Powered By: Snitz Forums 2000 Version 3.4.07