Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 19th, 2003, 02:57 PM
Ryan_Baxter Ryan_Baxter is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Indianapolis, IN
Posts: 40 Ryan_Baxter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Question Command Button

I'm learning as I go with Access, but I have come across a problem that I can't seem to figure out. I have a button that I have set to open a form, however I need it to open the form with a new record as the default and I can't figure out the code. Please help!!!

Reply With Quote
  #2  
Old November 19th, 2003, 04:19 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Is the form you are trying to load a bound or unbounded form?

Reply With Quote
  #3  
Old November 20th, 2003, 07:04 AM
Ryan_Baxter Ryan_Baxter is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Indianapolis, IN
Posts: 40 Ryan_Baxter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
it's an unbound form

Reply With Quote
  #4  
Old November 20th, 2003, 08:27 AM
Ryan_Baxter Ryan_Baxter is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Indianapolis, IN
Posts: 40 Ryan_Baxter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I tried to add an on open event and I keep getting errors. The code I'm using is probably wrong. Here is the code I'm using:

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec 'Add a new record.
LastName.SetFocus 'Move focus to Last name field.

End Sub

Also I'm sorry becuase it is a bound form not unbound. Can you let me know?

Reply With Quote
  #5  
Old November 20th, 2003, 11:11 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Put you code in Form_Load

S-

Reply With Quote
  #6  
Old November 20th, 2003, 11:21 AM
Ryan_Baxter Ryan_Baxter is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Indianapolis, IN
Posts: 40 Ryan_Baxter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I put the code on_load event and now I'm getting a run-time error: 424 and when I go to debug it is highlighted on this line:
LastName.SetFocus 'Move focus to Last name field. Any ideas why? It is also saying Object Required

Reply With Quote
  #7  
Old November 20th, 2003, 02:12 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Quote:
Originally posted by Ryan_Baxter
I put the code on_load event and now I'm getting a run-time error: 424 and when I go to debug it is highlighted on this line:
LastName.SetFocus 'Move focus to Last name field. Any ideas why? It is also saying Object Required


Does LastName exist as a text box.

The error is referring to that fact that the object (LastName) doesn't exist

S-

Reply With Quote
  #8  
Old November 20th, 2003, 02:23 PM
Ryan_Baxter Ryan_Baxter is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Indianapolis, IN
Posts: 40 Ryan_Baxter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Talking

Thank You very very much that worked

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Command Button


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 4 hosted by Hostway
Stay green...Green IT