Unexpected Row Inserted In A Code Table

Jun 22, 2005

I have the following tables, tblAudit and tblCriteria. The first records companies and period of audit, the second contains the criteria against which they will be audited. The audit period determines which criteria apply.
Results are recorded in a third table, tblAuditResults.

Relationships
tblAudit 1:M tblAuditResults M:1 tblCriteria

My problem is when I try to add a new result by selecting a criteria via a combo box a new row is inserted in the criteria table as well as in the result table. Inserting a row in the criteria table is wrong.

I have attached the database for you to look at.

Thanks for any advice you can offer.
Fearless

View Replies


ADVERTISEMENT

Primary Key Inserted In Another Table

Feb 18, 2005

Hello I have another prob. I need to be able to take a new ID from the topics table and insert it into the messages table after a form has been posted. I haven't got a clue on how to do this.

Its for a message board where a new topic is inserted. Two tables need to have records inserted, the topics table and messages table. The Topic_ID from the topics table is an autonumber and needs to go into the TopicID field in the messages table. Here's my insert query:

sqlString = "Insert into Topics (Topic, BSection, Username, MesDate) values ('" &_
Topic & "', '" & BSection & "', '" & Username & "', '" & MesDate & "')"
Con.execute(sqlString)
sqlString2 = "Insert into Messages (Username, Member_ID, Topic, Message, MesDate, BSection) values ('" &_
Username & "', '" & UserID & "', '" & Topic & "', '" & Message & "', '" & MesDate & "', '" & BSection & "')"
Con.execute(sqlString2)

I've tried using the identifier command but that didn't work so I haven't got a clue on what to do. Can anyone help?


thanks


Grant

View 14 Replies View Related

Modules & VBA :: How To Get Last Inserted ID In A Table

Sep 10, 2013

I have this code in Access VBA and it is not working.

Private Sub btnAddWorkingday_Click()
Dim strSQL As String
Dim strDate As Integer
Dim lastID As Integer

strSQL = "INSERT INTO tblSchoolWorkingDays (CALENDAR_DATE) VALUES ('" & tBoxDateToAdd.Value & "'); SELECT @@IDENTITY AS LastID;"

DoCmd.RunSQL strSQL
End Sub

View 7 Replies View Related

Text Box Expression Inserted To Table?

Mar 13, 2012

I have a text box on my table form with the expression =([LINES]-[MISSED LINES])/[LINES] which gives me the results I want but I also want this total to go to the "On time %" column in my table.

View 3 Replies View Related

Modules & VBA :: Email Address Inserted From Non Related Table

Sep 4, 2013

I have a table that holds company information for the user - eg farm name, company name, manager, phone number and email address etc. Its simply used to provide headers for reports, so that the same generic database can be used on several farms. There is only one record in this table tblfarmdetails.The second table tblorder is for orders and receipts - I currently have code that allows the user to send an order request by email to the manager, and to also send notice of receipt of goods through to the manager. I would like the code to get the email address from the unrelated table.Can I reference this field in the vba?

Private Sub cmdemailorder_Click()
Dim orderdate As String
Dim stafford As String
Dim item As String
Dim itemamnt As String

[code]....

View 8 Replies View Related

Tables :: Calculated Form Field To Be Inserted Into Table

Jan 3, 2013

i want to insert a calculated value of a e.g field6 (field4 * field5) in forms into the database table. by using expression builders in my forms. i have made that feild and on click it shows the calculated value but on filling in the rest of the form and clicking on Insert button does not update this calculated field but iserts all other fields.

View 3 Replies View Related

Forms :: Table Inserted Into Form No Longer Expands After Db Is Split?

Aug 20, 2013

I have elected to have tables inserted into my forms. For example on the School Information form, I have the Employees table inserted at the bottom so that it will show the employees that are assigned to that school when it's pulled up.

Before I split my database into a BE/FE situation, I could expand the items in the tables to other related items, but now that option is gone.

Is there any way to get that back with a split database?

View 7 Replies View Related

Unexpected State

Jul 13, 2005

Ok, I know you guys have heard about this problem quiet a few times, my search told me that. But my problem has a bit of a twist. The message appeared when I tried to open the database yesterday, so I went to the backups and tried to open them. All the backups for the past month give the same message. The problem is with the FE only, the BE is working fine. The backups are connected to the same workgroup as the FE and BE. Has anyone seen this before and know what might of happened?

View 8 Replies View Related

Unexpected Error (40230)

Dec 1, 2005

Ever since I switched from using a Mapped Drive to using the UNC path for my linked tables, i occassionally get Unexpected Error (40230).

I noticed this first when i manually re-linked using the link table manager, it linked the tables, then gave me this error several times, likely reflecting the number of tables i linked, but the links refreshed.

I then noticed this error when i used the acCmdZoom method on a textbox control on a continuous form. It opened the zoom, then gave me the same error several times, likely reflecting the number of records on the form, (i just hit the esc key to scroll through all the errors quickly.)

Any thoughts would be much appreciated,

*** UPDATE, Ok, I just did a Linked Table Manager again, got the error 112 times (or so), which is nowhere near the number of tables linked. After the error occurs once, and you perform that operation again, the error does not happen. Same thing when zooming, the error occurs sever dozens of times, but when i perform the zoom again, it does not repeat the error.

STILL NEED HELP

~Scott

View 8 Replies View Related

Unexpected Behaviour In Sub Form

Dec 24, 2004

Why does my sub form which is contained in a Tab, not display unless a certain field is populated with something? It's not a required field. Infact it is one of two identical fields... a relationship and a lookup to another table. It doesn't matter if the second one if filled in or not. Just this one. The record is in the database, I choose from a drop down in the header... and the subform then requeries and displays the information. However, unless this 1 field is filled in.. the subform remains blank. It is getting on my nerves!!

View 1 Replies View Related

Reports :: Unexpected Field Format

Mar 21, 2015

A report field data is sourced from a query which displays its values as a string eg "George Renee", however in the reports it displays data as a number eg 42. It is true that the query field obtains its data from a table which gets its data through lookup Wizard. I really want the report to display string type.

View 1 Replies View Related

Unexpected Error From External Database Driver

Jun 14, 2006

I am getting this error message:
"Unexpected Error from External Database Driver" when I try to import some .dbf files into Access. I just did some quick research, and it was suggested that I remove or rename the borland driver. Not sure how I feel about attempting that, plus, where do I get a new borland driver once the old is removed/renamed.

View 1 Replies View Related

Complex Query/form Results Unexpected

May 16, 2006

I've got a query pulling data from a view I created that gives all the data I need. The query gets it's criteria from a form with 10 combo boxes, a radio box with 3 options and 2 date fields for the timeframe to run the report in.

The issue:
over half the columns of data that the radio buttons can limit results by have null values but only two of the columns are excluding records where the values in them are null. As any combination of the combo boxes are null I'm using the following format for my criteria per column
IIf(IsNull([Forms]![Margin Dialog]![InstallerOption]),[Installer_from_Web],[Forms]![Margin Dialog]![InstallerOption])
That is an example of a column that works, the following is a column that is excluding null values no matter what I do
IIf(IsNull([Forms]![Margin Dialog]![AOIOption]),[ProductType],[Forms]![Margin Dialog]![AOIOption])
I am not seeing the error and could use some thoughts.

View 13 Replies View Related

Joins Producing Unexpected Number Of Records

Apr 17, 2008

i have a table with 3740 records in it

i do a query and outer join this table with a query and it produces LESS records = 3733

:confused:

now i always assumed (never assume it makes an "ass" out "u" and "me" !) that the records would be the same as the table you were joining from, obviously i've assumed wrongly, but why?

the query i'm using as my lookup query is grouped and i think that is causing me problems...if i turn it into a table, it works as expected

:confused:

and i check the obvious: no filters or SELECT DISTINCT...

any suggestions/explanations welcome

View 3 Replies View Related

Forms :: Unexpected Data Retrieval In Form

Aug 31, 2014

I have an entry Form which is used to record prospective new members of a society in a Table named 'Foreigners' in a Membership Database using Access 2010. The entry form also records the name of the 'Interest Group' to which the prospective member is initially affiliated.

On entering this Group Name, selected from a drop down list from the Groups Table, The Group ID & Leader Member ID are automatically recorded.

However, I don't wish to record the Leader Member ID, what I wish to record is the Leader's Member Name which is identified by that ID in the related 'Mail List' Table.

In the Properties sheet the relevant source for this field is shown as Leader, but what is displayed is the Leader ID...

View 5 Replies View Related

General :: Unexpected Syntax Error On Update

Sep 19, 2012

I have a website which uses a series oif ASP/VBscript scripts to access and update an Access database. It has run for years on a shared commercial service.I also have a replica of the wesbite on my home pc for development and testing running under XP Pro and IIS. All works fine.

Recently I have had to switch my home setup to my laptop (also XP Pro and IIS). The scripts all appear to work ok except when I try to UPDATE certain tables.

Some give "Syntax error in UPDATE statement."
Some give "Data type mismatch in criteria expression."
Some work without error

Yet the identical script and table on the main site and my home PC work fine and have done for years.

View 14 Replies View Related

Queries :: Query With Instr Returns Unexpected Results

Aug 26, 2014

I have Access 2010. If I run this query

Code:
SELECT Reference,
InStr(1,FunctionThatReturnsLongString(), ResponsiblePerson) As MyField
FROM MyTable
WHERE
(Reference ='ShouldBeOut'
OR
Reference = 'ShouldBeIn1'
OR
Reference = 'ShouldBeIn2')

It returns 3 rows, with values in MyField of 0, 23 and 355.

Now I add 1 more where clause to filter on MyField and the query looks like this:

Code:
SELECT Reference,
InStr(1,FunctionThatReturnsLongString(), ResponsiblePerson) As MyField
FROM MyTable
WHERE
(Reference ='ShouldBeOut'
OR
Reference = 'ShouldBeIn1'
OR
Reference = 'ShouldBeIn2')
AND
(
InStr(1,FunctionThatReturnsLongString(), ResponsiblePerson) > 0
)

So, you would think that it should return 2 values (ShouldBeIn1 and 2), but it doesn't. It only return the value where the Instr returns value of 23. The one with the value of 355 also disappears. Why would that be? Surely Instr does not return a byte?

View 10 Replies View Related

Combobox Value Inserted As ID#!!

Aug 23, 2005

I am just starting with access and I have a VERY stupid question. I made a combobox (it gets its values from a table with 2 colums the first the ID and the second is the products) when a user selects one of the products in the combobox the combobox is supposed to update another table with that value (and I mean the product name) yet what it updates is the ID # of the product that was selected!! How do i go around this.
I am new to access so i am not sure how things are done yet in access, i am pretty good in VBA in excel, but this is a new front for me that I am trying to learn. I did the above combobox using the wizard.

Layth

View 2 Replies View Related

Subform Inserted Into A Form

Jan 5, 2007

I have a subform generated by a query, I then have a double click function to run a further query this works when I open the subform separatly, but if I open the form and then double click on the field in the subform this will give me a error!

View 5 Replies View Related

Retrieve A Value From A Previously Inserted Row

Feb 19, 2006

Hello,
Im using a ASP and MS Access 2000 database. What im trying to do is: I insert a row into a table, in that table is a field that auto increments. after I insert this row I want to immediately after that be able to retrieve the value of the column containing the auto increment and hold it in a variable so i can use it for other things....

can anyone help me with this? I have been messing around with SQl cursors but cant seem to get it to work right..

Thank you very much
-Justin B.
Edit/Delete Message

View 4 Replies View Related

Getting The Properties Of The Record Last Updated/inserted

Apr 27, 2006

New here, looks like a great resource.

I have a question about a form which has several fields on it. What I need to do is to capture the ALL the fields of the record I just entered(updated or inserted)

So, for example, if my form has fields for

RepID, RepName, Company

After I edit or insert a new record, when I click to the next line, is there a way I can use AfterUpdate event to capture ALL the fields that were just updated on the form, and do whatever it is I need to do with them? I hope I am amking myself clear. Thanks for taking the time to look.

View 6 Replies View Related

Queries :: Use Inserted Value Dynamically At Run Time

Oct 16, 2013

I am inserting a new record into a 'master' table. Primary key is generated using a sequence. Now using that newly inserted primary key value, I need to insert a new record in child table. These 2 insert queries need to run at the time of deployment. how shall I store that primary key in a variable so that I can use it immediately in next insert statement?Can I use a returning into clause?

View 2 Replies View Related

Tables :: Text Automatically Inserted?

Apr 24, 2013

I have a table of nursery school children, names, addresses etc etc. One field is Under 2? Is there a validation rule (or something like) that will automatically put Yes (or No) depending on today's date and the child's date of birth?

View 6 Replies View Related

General :: VBA Select Query With Inserted Value

Feb 13, 2013

With the following VBA code, I'm trying to select the text value from a textbox and fill that in a query to select the code from a person. (a password only login).

However, I'm getting a run time error 3078 at the '' Set rs = db.OpenRecordset("strSQL")'' line.

Code:
Private Sub Tekst6_AfterUpdate()
Dim strSQL As String
Dim strBarcode As String
Set db = CurrentDb()
'strBarcode = Me.Tekst6
'MsgBox strBarcode

[Code] .....

View 8 Replies View Related

Forms :: Tax Calculation Cannot Be Inserted In Database

Oct 17, 2014

I have created a From with some Fields: Name, Surname, Netto Price, Tax (%) and Gross Price..... to make a invoice.

The Problem is that i cant insert the data from: Tax and Gross Price in to the DB.I have tried this:

select Tax Field--> Property Sheet -> Control Source: =[Price]*0,19

example:
Netto Price: 100
Tax 19%-- =[Price]*0,19 = 19

Now I get the correct values ​​displayed in Field Taxes.But this this sum cant not insert in to the Database.I use MS Office 2013.

View 9 Replies View Related

Wrong Year Inserted From Calendar Control

May 31, 2006

Hi there,

I have used Calendar controls before but this is a new one on me?!
When i click on the Calendar, what i am doing is inserting the date clicked into a textbox on another form.
The Calendar is set to todays date the system date is also correct and although i click on 31/05/06, what is being inserted is 31/05/20 ?????

Any ideas, because i dont?

Thanks in advance

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved