Avatar billede bmhaj Praktikant
21. juni 2013 - 17:47 Der er 7 kommentarer og
2 løsninger

Sql kode - fra tekst til tal

Jeg har af Terry fået en fin lille kode, som giver muligheden for at vælge 'Alle' i en liste, som ellers ville give et afdelingsnr.

Men koden afleverere tallet som tekst, hvilket giver mig et problem når værdien (afdelingsnr.) skal anvendes som filter i en anden query.
Avatar billede terry Ekspert
21. juni 2013 - 18:19 #1
You can access all of the columns in the combo.

Me.NameofCombo.Column(0) is the first column in the combo
Avatar billede terry Ekspert
21. juni 2013 - 18:23 #2
Mybe didnt quite understand the problem :-(


you can convert  text to other values. EG a text to a Long (integer)

CLng("123")
123

Is the column in the table numerical, if not you should convert it.
Avatar billede bmhaj Praktikant
21. juni 2013 - 18:58 #3
The thing is that I have 2 combos:

1) The first with the 'Alle' function.

2) A second where the value from no 1 should return a list within a 'Afdeling'

The me=...... only returns one line were it should return a number of lines - so it dosn't work.

If no 1 is 'Alle' then there should be no filter on no 2. And if something is choisen in no 1 the list should describe that 'Afdeling'
Avatar billede terry Ekspert
21. juni 2013 - 19:13 #4
I'm going to be away for the w/e otherwise I'd take a look at your dB.
Heres a link which explains how to filter the contents of one combo depending on value chosen in another.

Your obvioulsy going to have to take into account "alle"

http://support.microsoft.com/default.aspx?scid=kb;en-us;289670&Product=acc2002
Avatar billede bmhaj Praktikant
21. juni 2013 - 20:21 #5
Dont mind waiting for next week. Have a nice weekend.
Avatar billede terry Ekspert
21. juni 2013 - 20:34 #6
Thanks. You can maybe send dB to ekspertenATsanthell.dk
AT = @ and I'll look ASAP

you have a good w/e too
Avatar billede terry Ekspert
24. juni 2013 - 10:43 #7
I've changed the filter in the query you use in the activity combo to [Forms]![frm_Hovedmenu]![frm_Økonomien].[Form]![Afdeling]
Avatar billede terry Ekspert
25. juni 2013 - 17:56 #8
dont forget to close :-)
Avatar billede terry Ekspert
27. juni 2013 - 19:18 #9
thanks
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