Work Around For Error 2046?
Apr 17, 2006
I have searched in vain folks. I tried the microsoft website relating to the known bug about Error 2046 as it relates to openform using the docmd but I couldn't get it to work, either work around of the 2 listed.
So I come to you all.
My problem. I have a form that opens and the kind user enters his/her information into and then they click SAVE. Naturally I have a little "better mousetrap" YES/NO/CANCEL window appear that is coded with cases for each option.
YES being the norm (they are sure they want to save it so do it) they click it the nice little option goes away and promptly returns them to the same window they just entered there stuff into and not back to the main menu as it had forever up until now. So they of course being the good users try it again with the same results. Forever basically until they get sick of it and then they call me.
I get no error messages and no saving of the record NOTHING.
Can someone enlighten me on how best to work around or better fix this problem?
Thanks.
View Replies
ADVERTISEMENT
May 24, 2005
The following code has been used to simply copy the contents of two fields[memo] and [footer] to two other fields [memosent] and [footersent]. The code works up to the point where it reaches the "accmdcopy" for the second field. At this point I get a Run-time error 2046-the command or action copy isn't available now. The code following works OK if I exclude that line. I cannot see anything wrong with it.
My searches of this error do not provide any answers as they generally refer to opening and closing forms or reports when the Database window is not in view.
Can anybody throw some light on this please?
:confused:
Private Sub Command59_Click()
DoCmd.GoToControl "memo"
DoCmd.RunCommand acCmdCopy
DoCmd.GoToControl "memosent"
DoCmd.RunCommand acCmdPaste
Me.Footer.SetFocus
DoCmd.RunCommand acCmdCopy
DoCmd.GoToControl "footersent"
DoCmd.RunCommand acCmdPaste
DoCmd.GoToControl "memosent"
End Sub
View 6 Replies
View Related
Oct 3, 2006
I've been using this database now for a good few years without many problems but now that I upgraded from 2000 to 2003 It's been playing up on me :confused:
The problem only occurs on my PC & not anyone elses, so I don't think it's a database problem but maybe something on my machine. I have not upgraded any other PC's yet. Only mine as a test.
The database is split & shared on our sever with each user having a copy of the front end on their PC
I even copied a working front end from another PC to mine but it still fails.
http://johnviki.com/images/runtime.jpg
http://johnviki.com/images/DoCmd.jpg
I've installed/removed access 2000 & 2003 a couple of times now but nothing seems to help.:confused:
Oh...I have checked the references
the only difference I see is that 2000 has Microsoft Access 9 object library & 2003 has Microsoft Access 11 object library
http://johnviki.com/images/2000.jpghttp://johnviki.com/images/2003.jpg
Any ideas?
Thanks
View 5 Replies
View Related
May 13, 2013
I am trying to sort with Docmd.Runcommand acCmdSortAscending
When it tries to sort a concatenated field i am getting the runtime 2046 Error
Code:
Private Sub cmbSort_AfterUpdate()
Select Case cmbSort
Case 1
Me.CompanyName.SetFocus
DoCmd.RunCommand acCmdSortAscending
Case 2
Me.DateCreated.SetFocus
DoCmd.RunCommand acCmdSortAscending
Case 3
End Select
View 3 Replies
View Related
Jun 7, 2006
Hi, hope somebody can help with this problem.
I have a med-large db shared on network. Am under some pressure to split front/back so more people can do data entry, but want the forms to be semi-finished before putting them on everybody's c:drive.
The problem is error handling for required fields. Some fields are required in the underlying tables because if users don't fill them in, reports are useless. But Access error msg for required fields are too strange, users just close down, maybe wrecking the thing. Don't want to eliminate Close button yet in case they get stuck in Access hell.
I got one ( !! ) field locked in well using LostFocus event, but what do you do if users just mouse into fields at random? LostFocus won't work if it never had focus, right?
(Would much prefer to just use unbound form and give choice of "Field is required" and "OK" or "Cancel this record" but realize that's asking for a lot of help here.)
Any assistance you can offer would be MUCH appreciated!! Vba course isn't until July.
Thanks,
View 9 Replies
View Related
Oct 23, 2014
I am building an access database for my college project and I essentially have a quotation form that when I click a button 'Convert to Invoice' it creates a new record in the invoice table and then creates new records in the invoice details table which match the quotation details table. This is working as it should but for only the first 2 customers in my customer table?
On the quote form I have a combo box which is linked to the customer table and updates the quote table based on the selection. If I select customer 1 or 2 and click 'convert to invoice' it works and opens an invoice form based on the inserted data however if I select any other customer it returns an error that the record wasn't added to the table due to key violations?
As far as I can tell I am not trying to update the primary keys in the Invoice Table or the Invoice Details Tables.
View 1 Replies
View Related
Feb 27, 2006
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:
pkfDriverIndex
strLastName
strFirstName
strInitial
strAddress1
strAddress2
strCity
strState
strZIP
datBirthDate
The fields in tblLICENSE are:
pkfUpdateIndex
fkfDriverIndex
datDateUpdated
strState
strLicNumber
datExpirationDate
ynViolations
ynActive
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 9 Replies
View Related
Sep 10, 2007
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 4 Replies
View Related
May 30, 2006
I’m a newbie to Access, I have done some simple things but I now have to do something that is out of my league.
I work in an engineering company and I'm trying to make a database that the engineers can select a specification quickly, a specification or spec is like a table. Things like materials, ratings, pipe Schedule, etc are stored in it. The spec says how strong a pipe will be.
When selecting a spec you have to look at the service (what the pipe is caring, eg high pressure steam, or low pressure water). Services also store things like Design Temperature and Design Pressure.
You are giving the Service, and you have to select a spec that will be able to handle the Design pressures. To do this you compare the Design pressure to the Maximum allowable Pipe pressure (it is calculated at the join (flange) as this is the weakest point).
One other pike of information is the Tables that have the Maximum allowable Pressure. To find the Maximum allowable Pressure, you need to know the Material, Rating and the Design Temperature. Each material has its own table.
If you have a look at the attached file then in tables, SPec has Spec ID (Spec) which is Primary Key. Flange Material (FlangeMat) and Flange Rating (FlangeRating).
The Flange Material should take you to another table, FlangeMat. This table is used to get you to the correct Maximum allowable Pressure table.
There are 2 Maximum allowable Pressure Tables, TABLE_211 and TABLE 212. Here the rest of the information from the Spec is needed (Flange Rating (these are the field names with 150, 300, 1500, etc numbers)). And also the Design Temperature is needed of the service.
Then it looks up the Maximum allowable Pressure from the Table and displays it. I was thinking a form.
Also the design Pressure needs to be displayed so the engineer can compare the two.
So for the form, there will need to be a drop down that has the Service, A drop down that has the Spec, and the two values, the Design Pressure and the Maximum allowable pressure.
All I have done is shown on the file, I started to play around with the Relationships and tried to create a Form but I could not get it to work so. I deleted it and left it with just the tables. If possible can someone please help me, maybe even get my file to work and the post the working one, I will then be able to understand it.
View 2 Replies
View Related
Jul 23, 2006
The company I work for uses A97 throughout. Although on my laptop I have Access 2003. I want to design my inventory control database using A2003 not 97 for obvious reasons. I know A97 users cannot open a Acess 2003 db.My Q is: If I created a A2003 db and also built some data access pages within the database and placed it on my server, could users view/add/edit records in the db via these pages using their web browsers? This would only be required across our small network of less than 10 users.Any advise welcome. Even just a YES or NO would help Many thanks.
View 4 Replies
View Related
Oct 6, 2006
Can anyone look at this database at let me know why it is not working
plse
Stuart
View 7 Replies
View Related
Dec 8, 2006
Hi All,
I need to create some conditional formatting on a field that will change the colour depending on how much money has been spent
I have MaxBilling As the Field I want to attach the condition formatting too which can be a user entered value or system updated depending on other things.
The Current worked costs total field Is Called Text119.
when a project starts The Cost will be 0 so I don't intend to assign a colour there.
when the Costs get to 50% of MaxBilling I would like to change the colour to Green
70% Chances to yellow
90% Would change to Dark Red
I can do most things but %'s and me don't mix well LOL
Any help would be much appreciated
thanks
mick
View 3 Replies
View Related
May 11, 2006
hey there kinda new to access...
how would i work out the amount of hrs worked?
e.g
time start at 8.00am, time finish at 5.00pm
how would i get to say 9hrs?
View 5 Replies
View Related
Dec 7, 2006
I have two database which are very similar. They both use the same back end table. I have a query that I developed in one db and it works correctly there. However, when I import it into the other db, I get the Ambiguous Outer Joins message. I've tried copying the SQL from one and pasting it into the other and that didn't help. I've checked the table used and they are all properly linked in the second db. Any ideas about what could be going on?
View 4 Replies
View Related
Apr 4, 2007
I have created a query thats initiated by a command button from a form and one of the criteria for the query is a 'Like' command.
On the form, various option buttons and combi-boxes determine the search criteria and put it into a hidden textbox. Then, the query is run based on the contents of that hidden textbox using 'Like'.
However, I cant seem to get the 'Like' command to work with the contents of the hidden [forms]![frmSearch].[txtSearchcriteria] field.
Do I need to edit the VB code on the form to format the text to include the Like '* prefix and *' suffix, or should my search box remain basic text and have the Like command in the query ??
I seem to have tried loads of variations incorporating the various components of the Like command (the asterisks, single quote marks and even the Like command itself) on either the Form field or query but nothing seems to work. Anyone have any ideas ??
Thanks chaps.
View 2 Replies
View Related
May 30, 2006
The on click event, for a Report, has the following:
Sub DateEntry()
Dim Start_Date As Date
Dim End_Date As Date
Start_Date = InputBox("Enter Start Date mm/dd/yyyy")
End_Date = InputBox("Enter End Date mm/dd/yyyy")
End Sub
This works fine and allows for Input. I added the sub below, but it does not work and the report opens:
Sub CheckEntry()
If Start_Date Is Null Then
MsgBox "No Date was Entered"
DoCmd.Close acReport, "Summary Action Report"
Exit Sub
End If
If End_Date Is Null Then
MsgBox "No Date was Entered"
DoCmd.Close acReport, "Summary Action Report"
End If
End Sub
View 5 Replies
View Related
Jun 9, 2005
I have a form with two textbox, when I type something in textbox, the second textbox is filled with database query "SELECT MAX...", this works in one PC but doesnt work in other...
Why ?
all PCs is Windows XP with Office 97 and 2000.
thx
View 1 Replies
View Related
Aug 5, 2005
I thought I understood Dlookup – but I am not able to make it work!
Here’s my scenario:
tbl_Details (GroupID, and other misc fields)
tbl_GroupList (AutoKey, GroupID, GroupName)
rpt_Report (GroupID, and other misc fields)
I would like my report to show the GroupName instead of GroupID (Data is entered as GroupID – hence, I created the look-up table “tbl_GroupList.”
I created a text box on my report:
=DLookup(“[GroupName]”,”[tbl_GroupList]”,”[GroupID] = Reports![rpt_Report]![GroupID]
I think my syntax is correct – I just can’t figure out why it won’t work. Do I need to link the tables?
I even tried DLookup in a query (changing the above code to fit the query fields) and can’t seem to make it work. Please help!
PS -- I don't think it matters, but I am trying to do this in a sub report.
View 3 Replies
View Related
Oct 5, 2006
i am trying to run an append query in SQL which appends a calculated value into another table 50 times incrementing the day by one day each time. When I run it it asks me for the parameter [NewDay] each time. It is obviuosly not picking up the variable.
Can anyone tell me why ?
Dim NewDate As Date
Dim n As Integer
For n = 0 To 50
NewDate = Date + n
DoCmd.RunSQL "INSERT INTO InventoryEvolution ( SAP, Stock, [Date] ) SELECT UK_Product_Estimate_Live.[RE SAP Code], ((Sum([Estimate01])+Sum([Estimate02]))/50)*-1 AS Stock, NewDate From UK_Product_Estimate_Live GROUP BY UK_Product_Estimate_Live.[RE SAP Code] HAVING (((UK_Product_Estimate_Live.[RE SAP Code])=513450))"
Next n
View 6 Replies
View Related
Jun 18, 2007
I created a database in MS Access 2000 for the company I work for.
I sent this database from the US to our sister company in the UK, and the gentleman there has no right-click access within the data entry form.
Is there something that needs to be turned on or a check box that needs to be checked for right-click access within the program?
Thank you in advance.
Jason
View 14 Replies
View Related
Jul 7, 2006
I need a database that will contain employee names and three job titles they will choose.
When a Job comes open I want to search the entire database and pull together a report that will show every employee that has chosen that job as one of his her three choices sorted by hire date.
I also would like a seperate table with the job titles and position codes that can be filled in automaticaly on the main form by typing the position code.
I have a database started with some of this but I can't get it to work right!
First I haven't got a clue how to make the job choice combo boxes link to the three textboxes on the form where the job titles chosen will be displayed.
Can someone please Help me?
Thanks
Charles
View 5 Replies
View Related
Aug 10, 2005
SELECT Table1.T1Field1, Table1.T1Field2, Table1.T1Field3
FROM Table1, Table2
WHERE (((Table1.T1Field1)=[Table2].[T2Field1])
AND ((Table1.T1Field2)=[Table2].[T2Field2])
AND ((Table1.T1Field3)=[Table2].[T2Field3]));
I took this code off another thread, and wodnered if it would work for mine.
I have two tables in the database, one is data we update monthly the other is data we get send monthly, each customer has a unique id, but not customer id's are included in the data we get sent. I need to match the customer by their id then the name and then the product group.
So firstly i want it to check the id if there is an id match then i want it to look for the product group. If there is no id i want it too look for the name then the product group. Will the code above work by doing this.
Thanks
View 2 Replies
View Related
Sep 14, 2005
Hi all,
I get this error "You tried to execute a query that does not include the specified expression 'SITENAME' as part of an aggregate function."
The query is:
SELECT o1.name AS SITENAME, o1.vertical_loc/10000000 AS LAT, o1.horizontal_loc/10000000 AS LON, c.CELLGLID AS CELLID, 'traffic_total' AS Expr1, sum((MEBUSTCH_HR+MEBUSTCH_FR)*period_duration)/sum(period_duration) AS Traffic, 'traffic_hr' AS Expr2, sum(MEBUSTCH_HR*period_duration)/sum(period_duration) AS Traffic_HR
FROM objects AS o1, objects AS o2, c_bts AS c, p_generic_cell AS p
WHERE c.int_id = o2.int_id and
o2.parent_int_id = o1.int_id and
p.bts_int_id = o2.int_id
GROUP BY SITENAME, LAT, LON, CELLID, Expr1, Expr2;
I know the problem is with the group by clause. In MySQL it just works using "group by p.bts_int_id. I learnt in access i have to include all non-aggregated fields in the group by clause, and that's what I've done!! WHY!!Please help me!!!
View 3 Replies
View Related
Oct 26, 2005
I have to tables.
one dummy and one main. The have the same fields.
the dummy is filled by a form.
i want to see where they are diffrent. But the query shows all the dummys records. I just want it to show the record that doesnt exists in the main table.
SELECT DISTINCT AttendenceDummy.MeetingCode, AttendenceDummy.EmployeeCode
FROM Attendance INNER JOIN AttendenceDummy ON Attendance.MeetingCode = AttendenceDummy.MeetingCode
WHERE (((AttendenceDummy.EmployeeCode)<>Exists (select Attendance.EmployeeCode from Attendance )));
View 2 Replies
View Related
Aug 11, 2006
if i do 2 at a time it wont work
but 1 at a time works, why is that?????
insert into room values ('00012','1A','B','120','00002','Sports Hall','N','0');
insert into room values ('00013','1B','B','20','00002','Changing Rooms','N','0');
Somebody please give me an answer
View 1 Replies
View Related
Mar 14, 2007
Hallo,
The following what I do not understand:
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdText
cmd.CommandText = "SELECT par1 FROM tblparameters Where tblparameters.gcnf = 'XMLexp' AND ((tblparameters.ccnf) Like 'ExpTijd*')"
Set rec = cmd.Execute()
Do While rec.EOF = False
MsgBox rec("par1").Value
rec.MoveNext
Loop
I don't get any result back. If I changed it likt the following:
tblparameters.ccnf = 'ExpTijd1' , in the query, I get one record back.
So my conclusion the query is right but the Like doesn't work in these circumstances?
thanks in advance.
Nico
View 3 Replies
View Related