value from combobox or user value

K

karmela

Hi,

I'm starting to program some forms with combobox which value is criteria for
a query. This combobox is based on a table.
I want user to select one of the value from that table (this is ok) OR user
specified criteria (* or like "abc*").

Is that possible?

Thanks karmela
 
K

KARL DEWEY

Is that possible?
Yes.
Had you posted your query SQL, form name, combobox name, and and textbox
user would enter thier data then I could have edited it for you.

Otherwise maybe you can decipher this --
WHERE [YourField] = [Forms]![YourFormName]![ComboBoxName] OR [YourField]
Like [Forms]![YourFormName]![TextBoxName] & "*"
 
K

karmela

Hi,

as I see, it means combobox for values from the table AND textbox for
entering user-defined values? I though about the property of combobox Limit
to List, so it should accept user entered value.
This [Forms]![YourFormName]![ComboBoxName] I have in criteria of the query
and the same with & "*" after it, but it does not function.

karmela

KARL DEWEY píše:
Yes.
Had you posted your query SQL, form name, combobox name, and and textbox
user would enter thier data then I could have edited it for you.

Otherwise maybe you can decipher this --
WHERE [YourField] = [Forms]![YourFormName]![ComboBoxName] OR [YourField]
Like [Forms]![YourFormName]![TextBoxName] & "*"
--
KARL DEWEY
Build a little - Test a little


karmela said:
Hi,

I'm starting to program some forms with combobox which value is criteria for
a query. This combobox is based on a table.
I want user to select one of the value from that table (this is ok) OR user
specified criteria (* or like "abc*").

Is that possible?

Thanks karmela
 
K

KARL DEWEY

This [Forms]![YourFormName]![ComboBoxName] I have in criteria of the query
and the same with & "*" after it, but it does not function.

'does not function' tells me nothing. Is there an error message and if so
what is it?

Too many records, no records, wrong records?

Post your SQL statement.
--
KARL DEWEY
Build a little - Test a little


karmela said:
Hi,

as I see, it means combobox for values from the table AND textbox for
entering user-defined values? I though about the property of combobox Limit
to List, so it should accept user entered value.
This [Forms]![YourFormName]![ComboBoxName] I have in criteria of the query
and the same with & "*" after it, but it does not function.

karmela

KARL DEWEY píše:
Is that possible?
Yes.
Had you posted your query SQL, form name, combobox name, and and textbox
user would enter thier data then I could have edited it for you.

Otherwise maybe you can decipher this --
WHERE [YourField] = [Forms]![YourFormName]![ComboBoxName] OR [YourField]
Like [Forms]![YourFormName]![TextBoxName] & "*"
--
KARL DEWEY
Build a little - Test a little


karmela said:
Hi,

I'm starting to program some forms with combobox which value is criteria for
a query. This combobox is based on a table.
I want user to select one of the value from that table (this is ok) OR user
specified criteria (* or like "abc*").

Is that possible?

Thanks karmela
 
K

karmela

Hi,
Im sorry - SQL of the query is quite long...
When I do not write anything to the combobox, there is error message
"Property not found", I think there should be some procedure on NotInList
property, but I have no idea, what to write .... I'm not really strong in it,
it's my first db.

Thanks a lot

karmela

SELECT faktury_dodavatel.Rok, faktury_dodavatel.[SAS Äíslo dokladu],
faktury_dodavatel.[Číslo dodavatele], Dodavatele.Dodavatel,
faktury_dodavatel.[Číslo faktury], DateSerial(Left(faktury_dodavatel![Datum
faktury],4),Mid(faktury_dodavatel![Datum
faktury],5,2),Right(faktury_dodavatel![Datum faktury],2)) AS [Datum faktury],
faktury_dodavatel.[SAS Äíslo dílu], faktury_dodavatel.[Číslo dílu],
faktury_dodavatel.[PoÄet ks], Round((faktury_dodavatel![Hodnota
faktury]/faktury_dodavatel![PoÄet ks])*Dimenze!Dimenze_ks,2) AS [Cena na
faktuře], CStr(faktury_dodavatel![Hodnota faktury]) AS [Hodnota faktury],
Round(([Dorovnaná hodnota]/faktury_dodavatel![PoÄet
ks])*Dimenze!Dimenze_ks,2) AS [Cena dorovnaná],
CStr(IIf((dorovnani_dodavatel![Hodnota faktury nová]) Is
Null,faktury_dodavatel![Hodnota faktury],dorovnani_dodavatel![Hodnota faktury
nová])) AS [Dorovnaná hodnota], dorovnani_dodavatel.[Datum dorovnani],
cenik_nakup.[A cena], cenik_nakup.MTZ, cenik_nakup.LN,
cenik_nakup.Dimenze_ks, cenik_nakup.Měna, cenik_nakup.[Platnost od],
cenik_nakup.[Platnost do], CStr(Round(cenik_nakup![A
cena]+cenik_nakup!MTZ+cenik_nakup!LN+cenik_nakup!LS,2)) AS [SouÄet ceny],
Round(([Cena faktury]/faktury_dodavatel![PoÄet ks])*cenik_nakup!Dimenze_ks,2)
AS [Nová cena], Round(IIf(cenik_nakup![A cena] Is Null,0,(cenik_nakup![A
cena]+cenik_nakup!MTZ+cenik_nakup!LN)*faktury_dodavatel![PoÄet
ks]/cenik_nakup!Dimenze_ks),2) AS [Cena faktury], Round([Dorovnaná
hodnota]-[Cena faktury],2) AS Rozdíl,
DateSerial(Left(faktury_dodavatel![Datum
příjmu],4),Mid(faktury_dodavatel![Datum
příjmu],5,2),Right(faktury_dodavatel![Datum příjmu],2)) AS [Datum příjmu]
FROM Dimenze INNER JOIN (Dodavatele INNER JOIN (cenik_nakup RIGHT JOIN
(faktury_dodavatel LEFT JOIN dorovnani_dodavatel ON (faktury_dodavatel.[PoÄet
ks] = dorovnani_dodavatel.[PoÄet ks]) AND (faktury_dodavatel.[SAS Äíslo
dokladu] = dorovnani_dodavatel.[SAS Äíslo dokladu]) AND
(faktury_dodavatel.Rok = dorovnani_dodavatel.Rok) AND
(faktury_dodavatel.[Číslo dílu] = dorovnani_dodavatel.[Číslo dílu])) ON
cenik_nakup.Díl = faktury_dodavatel.[Číslo dílu]) ON Dodavatele.[Číslo
dodavatele] = faktury_dodavatel.[Číslo dodavatele]) ON Dimenze.Dimenze =
faktury_dodavatel.Dimenze

WHERE (((faktury_dodavatel.[Číslo
dodavatele])=[Forms]![frm_Dodavatel]![Dodavatel] & "*")
AND ((DateSerial(Left([faktury_dodavatel]![Datum
faktury],4),Mid([faktury_dodavatel]![Datum
faktury],5,2),Right([faktury_dodavatel]![Datum
faktury],2)))>=[cenik_nakup]![Platnost od] And
(DateSerial(Left([faktury_dodavatel]![Datum
faktury],4),Mid([faktury_dodavatel]![Datum
faktury],5,2),Right([faktury_dodavatel]![Datum
faktury],2)))<=[cenik_nakup].[Platnost do])) OR (((cenik_nakup.[A cena]) Is
Null));


KARL DEWEY said:
This [Forms]![YourFormName]![ComboBoxName] I have in criteria of the query
and the same with & "*" after it, but it does not function.

'does not function' tells me nothing. Is there an error message and if so
what is it?

Too many records, no records, wrong records?

Post your SQL statement.
--
KARL DEWEY
Build a little - Test a little


karmela said:
Hi,

as I see, it means combobox for values from the table AND textbox for
entering user-defined values? I though about the property of combobox Limit
to List, so it should accept user entered value.
This [Forms]![YourFormName]![ComboBoxName] I have in criteria of the query
and the same with & "*" after it, but it does not function.

karmela

KARL DEWEY píše:
Is that possible?
Yes.
Had you posted your query SQL, form name, combobox name, and and textbox
user would enter thier data then I could have edited it for you.

Otherwise maybe you can decipher this --
WHERE [YourField] = [Forms]![YourFormName]![ComboBoxName] OR [YourField]
Like [Forms]![YourFormName]![TextBoxName] & "*"
--
KARL DEWEY
Build a little - Test a little


:

Hi,

I'm starting to program some forms with combobox which value is criteria for
a query. This combobox is based on a table.
I want user to select one of the value from that table (this is ok) OR user
specified criteria (* or like "abc*").

Is that possible?

Thanks karmela
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top