Regarding an Append Query

sometimes24

Registered User.
Local time
Today, 14:24
Joined
Feb 26, 2014
Messages
10
Hello everyone,
I'm super new to Access, let alone Windows, and have a project due in a week and YouTube video choose the EASIEST example to demonstrate - which doesn't demonstrate much.

I am giving two tables and I need to create a macro that automatically updates these tables depending on the value of a Yes/No field. If it's No, it's in the 1st table TableOne, if it's Yes it automatically updates to TableTwo.

So, the best way I saw to go about is to set up an append query and then create a macro that runs it

So my tables have the values FirstName, LastName and isValid (more but keeping it short)
So for my append query, I put TableTwo in the pop up I get. Then, where it asks for the field I put it
Field:FirstName
Table:TableOne
AppendTo:[TableTwo].[FirstName]
Criteria:[TableOne].[isValid] = 1

I do this for all (it was autocompleted except the Criteria field). I tried to keep Criteria with data only for isValid but that didn't work. I wrote it for all the field names, still didn't work. Any insight on what I might be doing wrong. Whenever I click run it says it'll append 0 rows.

I'm super new to Access (like 3 days new) so I would highly appreciate it if responses did not have jargon in it. - Last, I'm using Access 2013

Any and all help appreciated :)
 
Criteria:[TableOne].[isValid] = 1
I assume Isvalid is the Yes/no field you mentioned. If so, this could be the problem because a yes/no has values -1 for true, 0 for no. It will never = 1, hence why you got 0 records each time. So try -1 instead and see the situation changes!

I made the same mistake when I started using Access too. No idea why they have -1 instead of 1 like most other systems...
 
Oh, haha wow - feel a little dumb for not picking that up. I tried -1, it says appending 72 rows, I only have 5 rows in TableOne and only two have Yes clicked on. I went with it nonetheless but I see no change to either table. The AppendQuery though, when I double click on it has all these values that belong and don't belong (at least to me). Not sure what I am doing wrong - think you can give me any insight on that?

I want the tables to change.
 
Alright, I was actually able to get it to work YAAAY - so now it says it's only appending 2 rows BUT.. it's appending it to the Query table not TableTwo, how can I get it to append to TableTwo
 
Alright, I was actually able to get it to work YAAAY - so now it says it's only appending 2 rows BUT.. it's appending it to the Query table not TableTwo, how can I get it to append to TableTwo

If should append to whatever is chosen in the Append To box on the append query. The records also appear in the query table just to show you what records are going to be used for the append when you execute it (need to click the 'Run' button on query design view).
 

Users who are viewing this thread

Back
Top Bottom