Connecting Tech Pros Worldwide Forums | Help | Site Map

Forcing "Blank" to the beginning of a query

John Baker
Guest
 
Posts: n/a
#1: Nov 12 '05
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

Bruce Pick
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Forcing "Blank" to the beginning of a query


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:[color=blue]
> 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[/color]
Mike Storr
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Forcing "Blank" to the beginning of a query


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" <Baker.JH@Verizon.net> wrote in message
news:3hrt0090pgakj3er6q63bhg0jepu2i10n8@4ax.com...[color=blue]
> Hi:
>
> I have a query which supports a form. Te form is used to edit, update and[/color]
change records[color=blue]
> in the table the query is based on. It all works fine EXCEPT that the[/color]
"New" record (blank[color=blue]
> updatable record) always appears as the end of the form (i.e. the bottom),[/color]
whereas it[color=blue]
> would be very helpful if it appeared at the beginning (the top of the[/color]
form).[color=blue]
>
> Can anyone suggest a way to make this happen?
>
> Regards
>
> John Baker[/color]


PC Datasheet
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Forcing "Blank" to the beginning of a query


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
resource@pcdatasheet.com
www.pcdatasheet.com



"John Baker" <Baker.JH@Verizon.net> wrote in message
news:3hrt0090pgakj3er6q63bhg0jepu2i10n8@4ax.com...[color=blue]
> Hi:
>
> I have a query which supports a form. Te form is used to edit, update and[/color]
change records[color=blue]
> in the table the query is based on. It all works fine EXCEPT that the "New"[/color]
record (blank[color=blue]
> updatable record) always appears as the end of the form (i.e. the bottom),[/color]
whereas it[color=blue]
> 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[/color]


DFS
Guest
 
Posts: n/a
#5: Nov 12 '05

re: Forcing "Blank" to the beginning of a query


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" <Baker.JH@Verizon.net> wrote in message
news:3hrt0090pgakj3er6q63bhg0jepu2i10n8@4ax.com...[color=blue]
> Hi:
>
> I have a query which supports a form. Te form is used to edit, update and[/color]
change records[color=blue]
> in the table the query is based on. It all works fine EXCEPT that the[/color]
"New" record (blank[color=blue]
> updatable record) always appears as the end of the form (i.e. the bottom),[/color]
whereas it[color=blue]
> would be very helpful if it appeared at the beginning (the top of the[/color]
form).[color=blue]
>
> Can anyone suggest a way to make this happen?
>
> Regards
>
> John Baker[/color]


Closed Thread