|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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!!!
|
|
#2
|
|||
|
|||
|
Is the form you are trying to load a bound or unbounded form?
|
|
#3
|
|||
|
|||
|
it's an unbound form
|
|
#4
|
|||
|
|||
|
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? |
|
#5
|
|||
|
|||
|
Put you code in Form_Load
S- |
|
#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 |
|
#7
|
|||
|
|||
|
Quote:
Does LastName exist as a text box. The error is referring to that fact that the object (LastName) doesn't exist S- |
|
#8
|
|||
|
|||
|
Thank You very very much that worked
![]() |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Command Button |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|