2 doubts

cnuhima

Registered User.
Local time
Today, 13:51
Joined
Jun 19, 2008
Messages
72
Hi guys,

i am working on small project in access for which i use the access database itsef.

(1) I have a combo box in my application for which i want the default value as the first item.How Would i do that..
i tried default value option ..but no use

(2) I Have a Combo box which has the order numbers.If the User selects a particular order number..based on the selection the next textboxes must filled with the name and address of that particular order number from the access table.

Guys please help me out...
I need this as soon as possible..
Thank u in advance
 
A combo box is populated by the query that it is based on. If you can write the query so that the proposed default value is first in the list (ORDER BY) then you can get what you want. If that is not possible, then the following example from a previous post that I made provides a quick way to add a default.

I am sure there are 100 easier ways, but this little trick might work. If the Combo Box had a Record Source that was a query similar to:

SELECT distinct("All") FROM Table1
Union ALL
(
Select ClientName from Table1
order by ClientName
);

then the resulting list should look like

"All"
{Client List in Alpha order}

To control the text boxes , I think you can set the row sources to something like

SELECT Name FROM TheTable WHERE OrderColumnName = [ComboBoxName] AND
SELECT Name FROM TheTable WHERE OrderColumnName = [ComboBoxName]

Replacing TheTable, OrderColumnName, and ComboBoxName with appropriate values from your database
 
Last edited:
hi guys ,

even i tried but its shown page not available.

even the when i write query ..its showing error.

Select Full Name from Order where Order No = Order Number

I wrote like this in which

Full Name == column name in table

Order ==is the Table Name

Order No==is the Column Name in table

Order Number is the combo box name


Help me out
 
I see spaces in your column names. If there are then either change them to have no spaces, or wrap [] around them (like [Full Name], [Order No], and [Order Number]), and they will be interpreted properly
 
Last edited:
Hi,

I tried in that way too..but its giving error saying subquery must be enclosed in parenthesis..
 
I am missing something in your description. Can you cut and paste it here so we can see it?
 
Hi ,


select [Full Name] from Order where [Order No]=[Order Number]

When i write this is in the expression builder and trying to save it and close the property box its giving "check the subquery syntax and enclose it in the parenthesis.

Thank You
 
I suspect that the problem might be with your reference to the Combo Box. Although Its name is [Order Number], and you probably need to use the Full Name [Forms]![YourFormName].[Order Number] when referring to it in a query.
 
Don't use my pasted link, but click on the link from skaas in the "Query by Form" thread. It's located in the "Forms" listing (like this thread). I tried the link and it works.
 
Hi Guys,

I am not able to get ..i am not able to understand where I am going wrong.

Please help me out..

I you guys need i will explain the entire form..
 
Hi,

I tried in this way..

I copying the query here.pls guys let me know what is the wrong in it..


=(select [Full Name] from Order where [Order No]=[form]!.[Quoatation].[OrderNumber])

am i missing any thing here..while running the form its giving #name..

Pls let me Know..
 
=(select [Full Name] from Order where [Order No]=[form]!.[Quoatation].[OrderNumber])


Could you check the syntax ? I don't think there should be a "." between "[FORM]!" and "[QUOTATION]"...
 
Hi,

I tried in this way..

I copying the query here.pls guys let me know what is the wrong in it..


=(select [Full Name] from Order where [Order No]=[form]!.[Quoatation].[OrderNumber])

am i missing any thing here..while running the form its giving #name..

Pls let me Know..


The "." after the "!" is not required (see above). Also, I also think the opening "(" and the closing ")" may not be required, although they should not hurt either
 
hi guys,

i tried removing period..but its showing the same error.
 
Hi guys,
I modified the query like this..check this

=(select [FullName] from Order where [OrderNo]=[forms]![Quoatation].[OrderNumber])

Pls Help me out.
 

Users who are viewing this thread

Back
Top Bottom