468,537 Members | 1,922 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,537 developers. It's quick & easy.

Forcing "Blank" to the beginning of a query

Hi:

I have a query which supports a form. Te form is used to edit, update and change records
in the table the query is based on. It all works fine EXCEPT that the "New" record (blank
updatable record) always appears as the end of the form (i.e. the bottom), whereas it
would be very helpful if it appeared at the beginning (the top of the form).

Can anyone suggest a way to make this happen?

Regards

John Baker
Nov 12 '05 #1
4 1614
This is not exactly what you asked form but it might help:

You could set the form to "Data Entry". This opens the form to a new
record, and does not show existing ones. As records are added, it lets
you see only those you just added since opening the form.

The Data Entry property is on the Properties box, Data tab. You can
also set it via VBA code.

John Baker wrote:
Hi:

I have a query which supports a form. Te form is used to edit, update and change records
in the table the query is based on. It all works fine EXCEPT that the "New" record (blank
updatable record) always appears as the end of the form (i.e. the bottom), whereas it
would be very helpful if it appeared at the beginning (the top of the form).

Can anyone suggest a way to make this happen?

Regards

John Baker

Nov 12 '05 #2
I don't think that's a behaviour that can be changed. As by default,
records are added to the end of the table, and indexes are just ways to
order them when they are displayed.

Mike Storr
www.veraccess.com

"John Baker" <Ba******@Verizon.net> wrote in message
news:3h********************************@4ax.com...
Hi:

I have a query which supports a form. Te form is used to edit, update and change records in the table the query is based on. It all works fine EXCEPT that the "New" record (blank updatable record) always appears as the end of the form (i.e. the bottom), whereas it would be very helpful if it appeared at the beginning (the top of the form).
Can anyone suggest a way to make this happen?

Regards

John Baker

Nov 12 '05 #3
Mike is correct!

You can simulate what you want however in two ways.
Turn AllowAdditions off.
1. Place a row of unbound text boxes above your form for entering new records.
You can use a button or the AfterUpdate of the last textbox to:
a) Turn Allow Additions on
b) Add the contents of the textboxes to your table
c) Turn Allow Additions off
d) Requery your form to show the new record
e) Set all the textboxes to Null

2. Place a subform with Data Entry set to Yes, only one row displayed and
based on the same table above your form for entering new records. You can use a
button or the AfterUpdate of the last textbox in the subform to:
a) Turn Allow Additions on
b) Go to new record to save what was entered in the subform
c) Turn Allow Additions off
d) Requery your form to show the new record
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"John Baker" <Ba******@Verizon.net> wrote in message
news:3h********************************@4ax.com...
Hi:

I have a query which supports a form. Te form is used to edit, update and change records in the table the query is based on. It all works fine EXCEPT that the "New" record (blank updatable record) always appears as the end of the form (i.e. the bottom), whereas it would be very helpful if it appeared at the beginning (the top of the form).

Can anyone suggest a way to make this happen?

Regards

John Baker

Nov 12 '05 #4
DFS
In addition to the good suggestions by other cdma masters, you can place an
option group on the form, and add two option buttons:

* View Data (default option)
* Add Record

In the AfterUpdate event of the option group itself (call if frameData), add
code:

When you click the View Data option button (frameData = 1), set the subform
DataEntry = False and requery it
When you click the Add Record option button (frameData = 2), set the subform
to DataEntry = True

Your subform should have AllowAdditions = True. Thus the user can scroll to
the bottom to add a record, or click the option button and add it at the
top.

"John Baker" <Ba******@Verizon.net> wrote in message
news:3h********************************@4ax.com...
Hi:

I have a query which supports a form. Te form is used to edit, update and change records in the table the query is based on. It all works fine EXCEPT that the "New" record (blank updatable record) always appears as the end of the form (i.e. the bottom), whereas it would be very helpful if it appeared at the beginning (the top of the form).
Can anyone suggest a way to make this happen?

Regards

John Baker

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

235 posts views Thread by napi | last post: by
1 post views Thread by John | last post: by
4 posts views Thread by sid | last post: by
1 post views Thread by sid | last post: by
17 posts views Thread by teser3 | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.