Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS ACCESS & have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for

Sponsored Links:

Related Messages:
DoCmd.GoToRecord , , AcNewRec
i have a listbox that manipulates records on another form but in case i click on one of the records in the listbox that doesnt have any corresponding record in the other form then instead of it saying that it cant locate the record i would like the form to go to a new record....

i've been trying at it but cant get it right...

plz assist... anyone.

View Replies !   View Related
DoCmd.GoToRecord Help Needed
Hi there

I am making a form that has been set up to have a number of tabs so I can have more then 1 page on the form.

One of the tab pages is used as a search form.There is a couple of textboxes and a listbox where the results end up
What I am trying to do is have a double click set up on the listbox so I can double click the result I want and have the forms ID goto that record.

Its a bound form. The primary key is called PersonalID and its bound to a txtbox called txtPersonalID.

this is my code but its not working

Private Sub lstSearchResults_DblClick(Cancel As Integer)

Dim strPersonalID As String
strPersonalID = Me.lstSearchResults.Column(0)
DoCmd.GoToRecord acActiveDataObject, "PersonalID", acGoTo, strPersonalID
DoCmd.GoToControl "pgePersonalInformation"

End Sub

When I try run the code I get an error 2489. saying The object 'PersonalID' isn't open.

What am I doing wrong?

Can anyone help out


View Replies !   View Related
"DoCmd.GoToRecord , , A_NEWREC " What Action Will Be Taken When This Stmt Executed

could you please tell me what action will be happned when this both statement executed..

DoCmd.GoToRecord , , A_NEWREC
SendKeys "%N", True

Form ahse defines these statement as well.

Option Compare Database
Option Explicit

View Replies !   View Related
DoCmd.TransferDatabase Doesn't Work
I have an Access 2003 database which is soon going to run out of space when we hit the 2Gb limit for the linked MDB that holds our biggest table of 2.5 million records.

So, management decided that we had to migrate the table to linked-Oracle - however, the performance of the large queries that depend on this Oracle linked table is abominable - they take up to 15 times as long to return as when using an internal Access table - hours instead of minutes.

So management have decided to migrate the whole application to Oracle - but in the meantime until this new system goes live, I have to make a cut-down version of the original Access table with only the fields necessary for the queries that are slow under Oracle, and populate it from the Oracle table as a kind of cache. This also saves relinking all the other databases and spreadsheets that refer to the original Access table.

However, there seems to be no way that Access can get these records without taking a ridiculously long time, or raising errors that are so STUPID that it implies Microsoft didn't bother testing the Access Import methods (probably programmed by an intern) before releasing the product.

PLEASE can anybody help?


Here are the methods I have tried:-


DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN={DSN as shown in ODBC Administrator};UID={uid};PWD={password};" & "DATABASE={Oracle Service name}", acTable, "{Oracle Table Name}", "tbl_ORACLE"

First, it returned the following error, as I hadn't created a target table (I thought it would auto-create one with the correct schema):-

"The Microsoft Jet database engine could not find the object 'tbl_ORACLE'. Make sure the object exists and that you spell its name and the path name correctly."

So, I used Copy/Paste (structure only) to make a blank target table 'tbl_ORACLE' with exactly the same schema as my linked Oracle source table. It then gave this error:-

"The Microsoft Jet database engine could not find the object 'tbl_ORACLE1'. Make sure the object exists and that you spell its name and the path name correctly."

So, it's added a "1" on the end of the name of the table I explicitly supplied ... and then said it couldn't find it!!! So, I created a copy table named 'tbl_ORACLE1' - it then said it couldn't find 'tbl_ORACLE2' !!!


I tried writing a simple SELECT...INTO statement, where I insert the linked-Oracle fields that I want to keep into the blank target Access table. 14 hours later overnight, and it still hadn't finished!!!


The Oracle programmers also have the data in a text flat-file format, so I tried importing using the

DoCmd.TransferText acImportDelim, "ORACLE_Import_Spec", ...

method, which works if the flat-file is empty apart from field definitions.

However, if there is any data in the Oracle flat-file, Access returns inexplicable "Numeric Overflow" errors (with no helpful debug text like row number, field name, etc) if there are any non-skipped numeric or date fields in the Import Spec - despite my spending about 2 working days trying all possible variations of datatypes in the Access Import Specification dialog.


In desperation, I decided to try loading the data the hard way, using LINE INPUT to get each line in turn from the flat-file and rs.AddNew, etc, to add the records one-by-one to the Access table.

However, since Microsoft didn't bother putting an optional "input date format" parameter on the CDate() function, I have to use the Format() function to convert the entirely normal "YYYYMMDD HH:MM:SS" date format in the flat-file to something that Access can understand with no possibility of confusing US (MM/DD) and non-US (DD/MM) date parameter orders.

So, I hit the bug in the Format() function where it always returns "Jan" regardless of what month you supply. Try this:-

Debug.Print format("09", "MMM")

or with any month you like instead of the "09".

Likewise, the other bug in the Format() function where it returns random dates. Try this:-

Debug.Print format("0109", "DDMMM")

You won't get 9th Jan or 1st Sept...

View Replies !   View Related
Docmd.close - Doesn't Work
Hi there Access-Experts

I've got a strange problem in that when I use docmd.close acForm, "formname" it doesn't actually close the form...

I have a form which is exporting data to excell. As the process takes ages, I have another form which is a progress bar. The progress bar works well, but when I'm done and I close my export form, the progress bar form is sitting there still, unclosed. Despite being told to go away.

Any ideas?


View Replies !   View Related
GoToRecord New
I'm having trouble getting my subform to go to new record from a main form.

How would I go about making a command button(new record) on a main form link to a subform.

Example: After clicking on command button I would like my main form and subform to go to new record.


View Replies !   View Related
GoToRecord Procedure
I have the following code in my VB:

DoCmd.GoToRecord , [Response Tasks], acGoTo = [Response_ID], "08"

This is not working however.... The table name is Response Tasks, the Column name is Response_ID and I am trying to pull the info from the one named "08". What am I doing wrong in the procedure?

Thanks in advance

View Replies !   View Related
Gotorecord Subform
Hi All,

I have a subform in which users kan edit a field. Some contain more than 100 records. After 'an edit' the code save the adjustments in the table. Then the subform automatically jumps to the first record, but I want it to go to the previous record which they just edited. Is that possible? Here's the code so far:

Private Sub Afgehandeld_Click()
If Afgehandeld.Value = 0 Then
AfgDatum.Value = Null
DoCmd.OpenForm "formulier5"
End If
End Sub

View Replies !   View Related
GoToRecord Problem!!
Hi there I currently have a DB with a ton of records. What I want to do is have a search box pop up when the user presses a button on the main form. When this search box comes up there is a list box with all the records. The user will then double click a record on the List box and it should appear on the main form. However this is not happenening. Here is my code for the double click in the list box.

Private Sub List3_DblClick(Cancel As Integer)
On Error GoTo Err_List3_DblClick
' Open the info form based on the selection in this listbox.

Dim strFormName As String
strFormName = "complaints"

DoCmd.OpenForm strFormName
DoCmd.GoToRecord , strFormName, acGoTo, " caseid = " & Me![List3] (I think this is where the error is)

DoCmd.Close acForm, "frmLookup"

Exit Sub


Someone please help!!!
MsgBox Err.description
Resume Exit_List3_DblClick
End Sub

View Replies !   View Related
GOTORECORD On Tab Control?

I have a subform on a tab control. How do I go to the last record of that sub form?

If I use the original form (not as a sub-form), the following code works, but when in the tab control I get an error that "blah blah Form is not open"

Any suggestions? Thanks

Code:DoCmd.GoToRecord acDataForm, "Stock Transfer", acLast'works when main form, but not as subform =/

View Replies !   View Related
Making A Look-Up Form Work The Way I Want It To Work!
We are creating a simple database to maintain driver license information for faculty, staff, and students who use cars from the universityís motor pool.

To do this, I have created two tables: tblDRIVER and tblLICENSE.

The fields in tblDRIVER are:

The fields in tblLICENSE are:

Information about the driver is stored in tblDRIVER and the driverís license information is stored in tblLICENSE. Periodically, we run a report that identifies drivers whose licenses are due to expire within a certain number of days. All this works fine.

My problem is that I am trying to create a lookup form that will load from a data entry form that will permit the Motor Pool Clerk to look up a driver by name and review the licensing information (which appears as a subform).

All this sort of works- I am using a combo box (based on a query) to look up a driverís last name (which it does) and to populate all the driverís information on the look-up form (including license information in a subform). Currently, the combo box locates the driver (including the unique index, last, and first names), and populates the form with first and last name but the rest of the information is not displayed on the look up form. Worse still, sometimes one driverís last name matches up with the first name of the next driver listed in the table! This seems to happen only if a look up is attempted more than once. What gives.

Thanks for the help.

View Replies !   View Related
How Can I Do A Simple "GoToRecord" In A Form?
I have searched the forum for questions similar to mine, but they all seem more complicated than what I need... and so I am getting a little confused with it all!

I would like to create a "GoToRecord" field in which people can enter a name which then take them to that record (stored in my "ClientName" field) on the Main form...

Can anyone help?


View Replies !   View Related
I Can't Get This To Work IIf Function Work For Me
I have an expression in one column of my query and It keeps returning a negative result and there are no negative numbers in the source data. Can anyone help. I just want to sum the sums the two IIf expressions, but its not working. Thanks

Other Qty: Sum(IIf([QSum]![ACCOUNT]=2 And [QSum]![ICUNIT]=95 And [QSum]![UNITS]="ITEM(S)",[QSum]![QUANT],Null)) Or Sum(IIf([QSum]![ACCOUNT]=2 And [QSum]![ICUNIT]=100 And [QSum]![UNITS]="ITEM(S)",[QSum]![QUANT],Null))

View Replies !   View Related
I am having issue with running a docmd.openstoredprocedure command in access 2000
DoCmd.OpenStoredProcedure "Proc_tblOpenReworks", acViewNormal
when i click on the cmdButton i get a
runtime error:7874 Microsoft access can't find the object "Proc_tblOpenReworks"
if this helps the cmd is run from a access project
is the and argument or some other way of running this command i would
appr. all the help i can get on this one

View Replies !   View Related
have searched on above but could not find anything

I want to start another database from within a database from a command button

Use the wizard option for RunApp and it appeared to work okay. definately pointing at the database.

Event procedure is

Private Sub Command39_Click()
On Error GoTo Err_Command39_Click

Dim stAppName As String

stAppName = "msaccess.exe C:LenWorking DatabaseSingle Non Conformance SystemDatabaseSecure Defect Docket Database.mdb"
Call Shell(stAppName, 1)

Exit Sub

MsgBox Err.Description
Resume Exit_Command39_Click

End Sub

Getting error saying that I was trying to use an option in command line that was not recognised.

Few clicks on the OK and the error message cannot find file

Any clues please


View Replies !   View Related
I have aproblem with the range of this thing. I think I have a wrong synthax or something.

I need to have the first 120 records of columns A and D
The first two lines aren't records but titles

So I had:
DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel8, "ExcelTEMP", mijnFile, False, "A3:A122;D3:D122"

Access tels me there is somthing wrong with the range, though it works in Excel :confused:

View Replies !   View Related
I've the following SQL query in my database:

DoCmd.RunSQL "INSERT INTO tblPlanner ( RACF, [Date], [Day Capacity], [Role Title], TimeWork ) SELECT tblStaff.RACF, [txtday1] AS Expr1, tblStaff.[Daily Capability], tblStaff.[Role Title], tblStaff.[Contract mins] FROM tblStaff WHERE (((tblStaff.TeamName) Like [txtTeamName])) WITH OWNERACCESS OPTION;"

The problem is everytime it runs it informe that the query will change data in the table. What can I do to stop it?


View Replies !   View Related
DoCmd Problem In ASP
I am trying to develop a page where users can click on alphabets to look for a company name that starts with the selected letter.
Searching through the forums i came across the method of using DoCmd.

alpha = Request.QueryString("alp")
if alpha <> "" then
DoCmd.ApplyFilter "", "[com_name] Like ""[" & alpha & "]*"""
end if

The 'alpha' variable here holds the alphabet selected by user from another page. However, I'm getting an error message saying

Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'DoCmd'

Initially i tried the usual filtering

if alpha <> "" then
rs.Filter = "com_name LIKE " & alpha
end if

The pages are suppose to display records in 10s. But instead of showing only the records of company starting "A" (example) it shows everything.

Please kindly point me to the correct direction to solve this problem.

Thank you so much.


View Replies !   View Related

I have spent sometime working on sending access reports to customers as asFormatHTML.

Code:DoCmd.SendObject acSendReport, "rptConfirm", acFormatHTML, strEmail, , , "Trade Confirms from Kyte Options " & date, , no, False

Trouble is some of my customers cannot read the attachment! Is it possible to have the message body display a txt of the report/query?

Thanks for any help you can give.

View Replies !   View Related

Copyright © 2005-08, All rights reserved