473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Sort form datasheet attempt crashes Access 2003 (error 3450-Access2007)

'add one textbox to form1 with Control Source property = ID
'copy/paste the form_load code below:
'Then open the form and then attempt to sort the datasheet
'crashes 2003, error 3450 Access 2007 - I can't find much info on
this... - Can someone explain what's happening and how to fix this?
Private Sub Form_Load()
'2008-01-11
Dim rsx As ADODB.Recordset
Set rsx = New ADODB.Recordset
rsx.CursorLocation = adUseClient
rsx.CursorType = adOpenDynamic
rsx.LockType = adLockOptimistic

rsx.Fields.Append "ID", adDouble

rsx.Open

rsx.AddNew 0, 1
rsx.Update

rsx.AddNew 0, 2
rsx.Update

rsx.AddNew 0, 3
rsx.Update

Set Form_Form1.Recordset = rsx

End Sub
Jan 16 '08 #1
2 3503
cu***********@gmail.com wrote in news:36a9ad3f-5474-4995-b8e1-
9e**********@i29g2000prf.googlegroups.com:
'add one textbox to form1 with Control Source property = ID
'copy/paste the form_load code below:
'Then open the form and then attempt to sort the datasheet
'crashes 2003, error 3450 Access 2007 - I can't find much info on
this... - Can someone explain what's happening and how to fix this?
Private Sub Form_Load()
'2008-01-11
Dim rsx As ADODB.Recordset
Set rsx = New ADODB.Recordset
rsx.CursorLocation = adUseClient
rsx.CursorType = adOpenDynamic
rsx.LockType = adLockOptimistic

rsx.Fields.Append "ID", adDouble

rsx.Open

rsx.AddNew 0, 1
rsx.Update

rsx.AddNew 0, 2
rsx.Update

rsx.AddNew 0, 3
rsx.Update

Set Form_Form1.Recordset = rsx

End Sub
I think that when one uses a virtual recordset as a form's recordset,
Access does not know what to sort.

I took liberties with your code as follows.

Dim rsx As ADODB.Recordset

Private Sub CmdSortDescending_Click()
rsx.Sort = "ID Desc"
Set Me.Recordset = rsx
End Sub

Private Sub Form_Load()

Set rsx = New ADODB.Recordset
With rsx
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockBatchOptimistic

.Fields.Append "ID", adInteger

.Open

.AddNew 0, 1
.AddNew 0, 2
.AddNew 0, 3

.UpdateBatch

.MoveFirst
End With

Set Me.Recordset = rsx
End Sub

You will note that I created a command button (in the form footer) to
effect a sort.

It all worked swimmingly in Access 2007.
Jan 16 '08 #2
On Jan 16, 5:34*pm, lyle fairfield <lylef...@yah00.cawrote:
curran.geo...@gmail.com wrote in news:36a9ad3f-5474-4995-b8e1-
9ec05b948...@i29g2000prf.googlegroups.com:
Hi Lyle,
Thank you for your suggestion and demonstration of adding a button and
code to sort the recordset on the button click event. we may have to
go this route with our 16-column datasheet - which would require the
ability to sort by any column. I guess we would need to remove the
default/standard Access menus/toolbars and specify a custom menu at
startup with no record sort option. Maybe there is still another way
around this... thanks again!
>
'add one textbox to form1 with Control Source property = ID
'copy/paste the form_load code below:
'Then open the form and then attempt to sort the datasheet
'crashes 2003, error 3450 Access 2007 - I can't find much info on
this... - Can someone explain what's happening and how to fix this?
Private Sub Form_Load()
'2008-01-11
* * Dim rsx As ADODB.Recordset
* * Set rsx = New ADODB.Recordset
* * rsx.CursorLocation = adUseClient
* * rsx.CursorType = adOpenDynamic
* * rsx.LockType = adLockOptimistic
* * rsx.Fields.Append "ID", adDouble
* * rsx.Open
* * rsx.AddNew 0, 1
* * rsx.Update
* * rsx.AddNew 0, 2
* * rsx.Update
* * rsx.AddNew 0, 3
* * rsx.Update
* * Set Form_Form1.Recordset = rsx
End Sub

I think that when one uses a virtual recordset as a form's recordset,
Access does not know what to sort.

I took liberties with your code as follows.

Dim rsx As ADODB.Recordset

Private Sub CmdSortDescending_Click()
* * rsx.Sort = "ID Desc"
* * Set Me.Recordset = rsx
End Sub

Private Sub Form_Load()

* * Set rsx = New ADODB.Recordset
* * With rsx
* * * * .CursorLocation = adUseClient
* * * * .CursorType = adOpenStatic
* * * * .LockType = adLockBatchOptimistic

* * * * .Fields.Append "ID", adInteger

* * * * .Open

* * * * .AddNew 0, 1
* * * * .AddNew 0, 2
* * * * .AddNew 0, 3

* * * * .UpdateBatch

* * * * .MoveFirst
* * End With

* * Set Me.Recordset = rsx
End Sub

You will note that I created a command button (in the form footer) to
effect a sort.

It all worked swimmingly in Access 2007.- Hide quoted text -

- Show quoted text -
Jan 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
7
by: Mike Nygard | last post by:
I'm experiencing extremely slow response times in design mode of my forms since moving to Access 2003. Simply dragging a button to a different position on the form takes 30 seconds or more. The...
6
by: Barry Edmund Wright | last post by:
Hi All, Is anyone using an error handler for MS Access 2003? I went looking for an error handler add-in for MS Access 2003 and found "123 Error Handler Wizard" from: aadconsulting.com...
1
by: Alan Lane | last post by:
Hello world: I am borrowing my daughter's laptop to make a presentation to a customer next week. It has Windows XP Pro, SP2 and Office 2003 Pro, SP1 on it. When I open a database in Access, I...
2
by: richp | last post by:
I recently built an Access 2003 database on my workstation. I have a client .mdb file with my forms/code, which links tables from an .mdb on our server. When I copy the client .mdb to a user's...
8
by: PW | last post by:
Hi, There is code in Alison Balter's excellant "Mastering Access 2003" to create a list of error codes and descriptions but it only generates error messages 3 through 94. Is there a website...
2
by: hbwhjack | last post by:
After I changed some reference in the menu of vba editor, it gave me the "error- please check that a valid file path was entered" when I press a command button on my form. What 's wrong with it and...
6
by: stuart | last post by:
I have 2 users who ran into a problem with a data entry program (written in Access 2003). One user was keying into one of the forms when she got the message "ACCESS Error Number: 3218 Could not...
4
by: wassimdaccache | last post by:
Dear, Does MS access 2003 provide user to use the command sort and filter in a report ? let us say I have many fields. User needs to choose each time a field to sort and then to print. Same...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.