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  

Open form to blank record



 
 
Thread Tools Display Modes
  #1  
Old July 10th, 2004, 11:32 AM
Deb Smith
external usenet poster
 
Posts: n/a
Default Open form to blank record

I want to open a form to a blank record but I do not want to allow
additions.

My form has a list box in the form header that is used to restrict records
shown on the form. When I open the form I want just the list box to show
without all the records from the list box showing below in the form.

Traditionally I have used DoCmd.GoToRecord, "", acNew Record to accomplish
this. However, since I do not want to allow additions but just want the
end-user to select and then edit the records and fill in one additional
field, I am not sure how to accomplish this task.

I am currently using the following code
DoCmd.OpenForm "Form5a", acNormal, "", "", , acNormal
Domd.GoToControl "[List2]"
DoCmd.GoToRecord , "", acNewRec

As I said this works great if I allow additions, which I do not want to do.

I would appreciate suggestions on how to accomplish this.

Thanks


  #2  
Old July 10th, 2004, 03:46 PM
Jim Allensworth
external usenet poster
 
Posts: n/a
Default Open form to blank record

One approach is to use a form/subform approach.

Put the listbox on the parent form.

Create a form for the records related to the listbox - set Allow
Additions to No. Use the listbox in the parent form for the criteria
of the records in the subform. Now use the form for the subform - use
the wizard.

In the After Update event of the listbox do a requery of the subform
control.

Me.sfrMySubform.Requery

That will bring up the records in the subform.

- Jim

On Sat, 10 Jul 2004 06:32:11 -0400, "Deb Smith"
wrote:

I want to open a form to a blank record but I do not want to allow
additions.

My form has a list box in the form header that is used to restrict records
shown on the form. When I open the form I want just the list box to show
without all the records from the list box showing below in the form.

Traditionally I have used DoCmd.GoToRecord, "", acNew Record to accomplish
this. However, since I do not want to allow additions but just want the
end-user to select and then edit the records and fill in one additional
field, I am not sure how to accomplish this task.

I am currently using the following code
DoCmd.OpenForm "Form5a", acNormal, "", "", , acNormal
Domd.GoToControl "[List2]"
DoCmd.GoToRecord , "", acNewRec

As I said this works great if I allow additions, which I do not want to do.

I would appreciate suggestions on how to accomplish this.

Thanks



 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
synchronizing form and list box Deb Smith Using Forms 8 June 21st, 2004 08:15 PM
error opening form "cannot open anymore databases" martin Using Forms 4 June 18th, 2004 06:07 PM
Populate two+ fields on a Form, based on a pop up form's record Michael Miller Using Forms 0 June 9th, 2004 02:56 PM
Command Button Opens blank record of seperate form with certain field pre-filled Carnegie23 General Discussion 2 June 5th, 2004 03:05 AM
surely a form with a ListBox can be used in a query? 1.156 Running & Setting Up Queries 14 June 2nd, 2004 04:54 PM


All times are GMT +1. The time now is 03:09 AM.


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