Parameter from Form displays garbage

IR_Moon

Registered User.
Local time
Today, 18:11
Joined
Jun 6, 2006
Messages
20
Hi there!

I'm trying to use an Invoice number from an Invoice form to populate a table of Invoice Lines with relevant records (linking by Invoice number). I realise the following SQL code isn't an append query, but I've simplified it to make it easier to explain

SELECT [Forms]![fInvoices]![SPInvNumber] AS MTInvNumber, tInvoices.SPInvNumber
FROM tInvoices
WHERE (((tInvoices.SPInvNumber)=[Forms]![fInvoices]![SPInvNumber]));

The output I get for this query is something along the lines of:

MTINvNumber | SPInvNumber
쉠 | 49760

THe MTInvNumber should read the same as the SPInvNumber, but it doesn't. If you can't see the above, its some sort of weird chinese/japanese character I think!

I thought maybe it was a display error, but I tried using it in my append query, and it inserted it as garbage too. The weirdest bit is it actually regards the form information as equalling the SPINvNumber from the tInvoices table! :S

Any clues on how I get it to format correctly??? I'm very tired now so it's bound to be something simple!
 
Sorry I may be missing the point here but why are you including a reference to a form in your select statement???

If you want a column for MTINvNumber then you would wrtie the query as:

SELECT tInvoices.SPInvNumber AS MTINvNumber, tInvoices.SPInvNumber
FROM tInvoices
WHERE (((tInvoices.SPInvNumber)=[Forms]![fInvoices]![SPInvNumber]));
 
Sorry that does seem rather circular and probably the worst example

Theres a bunch of things on my form that I want to spit out into my table via the append query. These things could be ascertained using an extra query... I Was just trying to be fancy and avoid using 17 queries to derive the results I needed when most of them are on the form I am looking at.

Cheers for your help... thats the easiest way to do it, yes... I Was trying to be waaaay too technical when the KISS approach would have worked. Might I add I was at the tail end of 40 hours work in 3 days when I asked ;)

Thanks muchly!
 

Users who are viewing this thread

Back
Top Bottom