Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 7th, 2005, 04:55 AM
Danny_Access Danny_Access is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 20 Danny_Access User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 49 sec
Reputation Power: 0
Forms....

When a form is opened it displays the last inputted data that was entered on the form. How do I get the form to display a blank form when the user opens the form. People from the office are writing over the current data!



Thanks.

Reply With Quote
  #2  
Old January 7th, 2005, 07:54 AM
ansentry ansentry is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Melbourne, Australia
Posts: 9 ansentry User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 2 m 35 sec
Reputation Power: 0
Put this in the On Current event of your form

Code:
docmd.GoToRecord ,,acNewRec

Reply With Quote
  #3  
Old January 7th, 2005, 08:56 AM
Danny_Access Danny_Access is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 20 Danny_Access User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 49 sec
Reputation Power: 0
When i go to open the form it now says it cannot open "docmd" macro.

I take it as though i need to make a macro to clear the fields?

Reply With Quote
  #4  
Old January 7th, 2005, 09:21 AM
Danny_Access Danny_Access is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 20 Danny_Access User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 49 sec
Reputation Power: 0
I read this somewhere else....

Quote:
I've struggled with this particular problem for a little while and I think I have cracked it as follows

In the OnLoad or OnOpen procedure in the subform

DoCmd.GoToRecord , , acNewRec


In the main form

in the OnCurrent procedure for the main form

Me![subFormName].SetFocus

Me![subFormName].Form![Control].SetFocus


( note the subFormName is as defined in the properties panel for the subform as it is embedded into the main form NOT as is listed in either the database manager or the associated list in VBA)


and in the OnEnter procedure in the embedded subform

DoCmd.GoToRecord , , acNewRec

Hope this helps

Im willing to try this out but need a bit of advice on the location of these properties on the subform and forms. Basically a finger pointing to say "its here!"

Thanks.

Reply With Quote
  #5  
Old January 7th, 2005, 11:30 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
In the properties of your form, find the On Current property. Place your curser into the text box. To the right of the text box you will see a drop down arrow appear. Next to the drop down arrow is the elipse (a button with three dots "..."). Click on the elipse button and a window will open. Select Code Builder, this will open the code window where you will place the code supplied by ansentry. Copy the code given and paste it between the Private Sub and End Sub. The curser will already be in the correct location for you to paste the code. Then close the code window and save your form. Now when you open your form, the form will be at a new record for data entry.

lwells

Reply With Quote
  #6  
Old January 10th, 2005, 03:57 AM
Danny_Access Danny_Access is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 20 Danny_Access User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 49 sec
Reputation Power: 0
Magic.

Reply With Quote
  #7  
Old January 10th, 2005, 04:15 AM
Danny_Access Danny_Access is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 20 Danny_Access User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 49 sec
Reputation Power: 0
Ive just noticed....

When i open the form it takes me to a new blank record, although when i try to navigate through previous records by using the previous or next buttons it doesnt display the previous record but just remains on the blank record.

How do i enable it to browse through previous records?

Thanks again!

Reply With Quote
  #8  
Old January 10th, 2005, 07:00 AM
ansentry ansentry is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Melbourne, Australia
Posts: 9 ansentry User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 2 m 35 sec
Reputation Power: 0
Danny_Access

Post a copy of your db (take out any info you don't want people to see) and let us have a look at your problem.

Reply With Quote
  #9  
Old January 10th, 2005, 08:23 AM
Danny_Access Danny_Access is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 20 Danny_Access User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 49 sec
Reputation Power: 0
I cant upload it as it wont allow databases. Id zip and upload it but we dont have winzip!
Any chance i can email it to you? If not i basically just need to be able to navigate through previous records and this new code will only display blank records....
Cheers.

Reply With Quote
  #10  
Old January 10th, 2005, 03:23 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Danny,

Check the forms property Data Entry.

If you have this set to Yes, then you won't be able to navigate back through the records. Check to make sure you have this set to NO and then when you open your form, you will be at a new record but will still be able to navigate back through old records. Also the code DoCmd.GoToRecord , , acNewRec actually needs to be placed in the Open event of the form not the Current Event. I didn't catch that earlier when previously posted by ansentry.

lwells

Last edited by lwells : January 10th, 2005 at 03:28 PM.

Reply With Quote
  #11  
Old January 10th, 2005, 06:08 PM
ansentry ansentry is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Melbourne, Australia
Posts: 9 ansentry User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 2 m 35 sec
Reputation Power: 0
Sorry, ( I have just declared myself idiot of the year) iwells is correct re the location of the code.

I hope it is working now for you.

Reply With Quote
  #12  
Old January 11th, 2005, 06:21 AM
Danny_Access Danny_Access is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 20 Danny_Access User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 49 sec
Reputation Power: 0
Yep it works now.

I think i take idiot of the year award.

Thanks again.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Forms....


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT