Avatar billede petersen7913 Forsker
14. januar 2008 - 11:05 Der er 11 kommentarer og
1 løsning

Hvordan laver man en (Oracle) post-queryi Access?

I Oracle er det meget let at lave en post-query, dvs. når jeg har hentet data ind i en formular kan jeg hente ekstra oplysninger ind på baggrund af de data, der er i tabellen. Typisk er der f.eks. et CustID i tabellen, hvor jeg så vil hente CustomerName ind.

I Access kan jeg hente alle data ind hvis jeg laver en forespørgsel og så baserer min formular på forespørgselen. Problemet er så, at jeg ikke kan oprette en ny række i formularen.

Jeg har overvejet at lægge et felt ind, som så skal hente f.eks. CustomerName udfra CustID, men hvordan skal det gøres, og hvordan får jeg så kaldt at data faktisk hentes?

Håber I forstår hvad jeg spørger om.
Avatar billede terry Ekspert
14. januar 2008 - 11:33 #1
Not quite sure what you mean. Are the tables in Oracle linked to Access with an ODBC DSN?
Avatar billede terry Ekspert
14. januar 2008 - 11:36 #2
Do you mean that you want to include data from related tables in the query?
Avatar billede petersen7913 Forsker
14. januar 2008 - 11:48 #3
No, there's no Oracle here ;-) My problem is, that I've used Oracle for a long time, so I know excatly how I can get the data if! I uses Oracle. But now I have changed to Access and it is quite different .... from Oracle.

I have an Order tabel: OrderID, CustID, .....
Then I have a Customer tabel: CustID, CustName, .....

I would like to make a formular based on the Order table, but I would like to show the CustName (as users don't like just to look at number ;-) )
so my formula should be like

OrderID, CustID, CustName, .....

But the problem is how to get the CustName and show it in the formula.
Avatar billede terry Ekspert
14. januar 2008 - 12:20 #4
You make a query which includes bothe tables and the fields you want. If the realtionships are correct then you shoul dbe able to make updates in the form.

If you make a query with both table then try editiin data directly in the query and if you canty update there then I suspect your relationhsips arent correct.
Avatar billede terry Ekspert
14. januar 2008 - 12:28 #5
When you design a table, for example the order table, you can choose Lookup as the data type. If you choose this type a wizrad is used which will allow you to select the Customer table as the related table and this will create a combo which will automatically show the customer name when you make a form.
Avatar billede petersen7913 Forsker
14. januar 2008 - 13:05 #6
I will try, thanks :-)
Avatar billede terry Ekspert
14. januar 2008 - 13:11 #7
I'll place an answer just incase it works :o)
Avatar billede petersen7913 Forsker
14. januar 2008 - 13:15 #8
This works, nice :-)

But if I don't just have a lookup, but a sum?

Like orderlines:

OrderID, sum(price pr. orderline), .....

I can make the query, but when I use the query in the formula it is not possible to insert new lines.
Avatar billede petersen7913 Forsker
14. januar 2008 - 13:17 #9
This is same as my other question, so I close this one.
Avatar billede terry Ekspert
14. januar 2008 - 13:30 #10
So you have a solution for this question?

Concerning your comment 14/01-2008 13:15:32 I'll go over to the other question you have open.
Avatar billede petersen7913 Forsker
14. januar 2008 - 13:55 #11
Yes, this one is OK
Avatar billede terry Ekspert
14. januar 2008 - 14:02 #12
If you accept an answer then you can close the question http://expfaq.dk/behandling_af_svar#behandling_af_svar

You have number of questions open which maybe you should close too
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester