If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > "Enter Data" command button that clears form after it's clicked

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-23-09, 06:36
Bartonap Bartonap is offline
Registered User
 
Join Date: Feb 2009
Posts: 1
"Enter Data" command button that clears form after it's clicked

I am new to using Access and I honestly don't have the first clue at what I am doing with coding command buttons.

Here's what I have so far . . .

I have two tables - "Goal Area/Service Level" and "Required Classes"
The two tables share a relationship
I have one Form - "Goal Area"
The form contains all of the fields that can be found in the two tables.

Here's what I want to do . . .
I would like the information that the user inputs into the form, to be added to the tables only after a command button is clicked. After that, I would like it to automatically clear the form so that the user can enter information for another student and there will not be inaccurate information.

Any assistance anyone could provide would be greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old 02-23-09, 15:18
nckdryr nckdryr is offline
Computer Monkey
 
Join Date: May 2005
Posts: 1,191
Welcome to the forums!

As a starting point (and assuming you have an unbound form), I would suggest looking into running an Append query. If you need help figuring out how to build and run a query from a command button, I would recommend looking at Martin Green's site, he has a six part lecture on VBA and SQL. After you build and run the query in the code, then you'd just need to clear the form; and if you need help on this, you might want to post what kind of controls you have, how you enter in the data, and basically define what "automatically clear the form" means.
__________________
Me.Geek = True
Reply With Quote
  #3 (permalink)  
Old 02-23-09, 19:29
StarTrekker StarTrekker is offline
L33t Helpa Munky
 
Join Date: Nov 2007
Location: Adelaide, South Australia
Posts: 4,049
At the most basic level, you should know that a bound form can only enter data into ONE table. Since you have a relationship between the two tables, I believe what you need is a mainform/subform. Should be easy once you've got that.
__________________
Owner and Manager of
CypherBYTE, Microsoft Access Development Specialists.
Microsoft Access MCP.
And all around nice guy!


"Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
"...teach a man to code and he'll be frustrated for life! " -- georgev
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On