A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

null default values on a form



 
 
Thread Tools Display Modes
  #1  
Old February 4th, 2010, 07:58 PM posted to microsoft.public.access.forms
Mikhail Bogorad
external usenet poster
 
Posts: 7
Default null default values on a form

Hi,

bet this question has been asked befo i have created a form so a
user can add new records and edit existing ones. For editing purposes
my form also has a search drop down by a record number. When i open
the form it always shows me the first record from the table, but i
just want it to be copmletely blank until a user choses his record for
editing. If i change Form properties (Data Entry =Yes) it works but
Search function does not work at all.

Thanks
Mike
  #2  
Old February 4th, 2010, 08:27 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default null default values on a form

"Mikhail Bogorad" wrote in message
...
Hi,

bet this question has been asked befo i have created a form so a
user can add new records and edit existing ones. For editing purposes
my form also has a search drop down by a record number. When i open
the form it always shows me the first record from the table, but i
just want it to be copmletely blank until a user choses his record for
editing. If i change Form properties (Data Entry =Yes) it works but
Search function does not work at all.



If you want your form to start at the new (blank) record, but still show all
existing records, you can put this code in an event procedure for the form's
Load event:

'----- start of code -----
Private Sub Form_Load()

Me.Recordset.AddNew

End Sub

'----- end of code -----

The same effect can be achieved with:

'----- start of code (alternative) -----
Private Sub Form_Load()

RunCommand acCmdRecordsGoToNew

End Sub

'----- end of code (alternative) -----

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

  #3  
Old February 5th, 2010, 01:39 PM posted to microsoft.public.access.forms
Mikhail Bogorad
external usenet poster
 
Posts: 7
Default null default values on a form

On Feb 4, 3:27*pm, "Dirk Goldgar"
wrote:
"Mikhail Bogorad" wrote in message

...

Hi,


bet this question has been asked befo i have created a form so a
user can add new records and edit existing ones. For editing purposes
my form also has a search drop down by a record number. When i open
the form it always shows me the first record from the table, but i
just want it to be copmletely blank until a user choses his record for
editing. If i change Form properties (Data Entry =Yes) it works but
Search function does not work at all.


If you want your form to start at the new (blank) record, but still show all
existing records, you can put this code in an event procedure for the form's
Load event:

'----- start of code -----
Private Sub Form_Load()

* * Me.Recordset.AddNew

End Sub

'----- end of code -----

The same effect can be achieved with:

'----- start of code (alternative) -----
Private Sub Form_Load()

* * RunCommand acCmdRecordsGoToNew

End Sub

'----- end of code (alternative) -----

--
Dirk Goldgar, MS Access MVP
Access tips:www.datagnostics.com/tips.html

(please reply to the newsgroup)


Thanks Dirk!
 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.