PDA

Click to See Complete Forum and Search --> : Access Form


nileshhthakur2004
Mar 14th, 2006, 04:38 AM
hi all, :bigyello:

i have two tabls one for Customer and other for Order, Now i have one
dropdown on form when Display Customer name, when i select CustomerName is show me Related Order for that customer,but problem is when there is no order for customer then it is suppose to show me blank value for that customer's Order but is show me frist records each time i don't know why ...

pls help me regading this ....

thanx in advance


Regards,

nileshhthakur2004
Mar 14th, 2006, 05:35 AM
hi all,
in my form i bind the main from to ordertable as
Record source = "Orders"
and i bind the ComboBox to Query as

i have bind DropDown to customer table with a primary key of CustomerID..And in my form i added textboxes bound to the fields and the combo box for searching the customerID.The combo box is not bound to the table.The record source type should be Table/Query...Use sql statement in the record source of the combo box....

Example...


Quote:
Select Customer.CustomerID, Customer.CustomerName, Customer.CustomerAddress from Customer;



Then in my combo box named Combo8, attach this code...



visual basic code:--------------------------------------------------------------------------------Private Sub Combo8_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[CustomerID] = " & Str(Nz(Me![Combo8], 0))
If Not rs.EOF

problem is if records is not found in order table then it set cursour to FristRecords..

pls help me regarding this..

thanx and regards

nileshhthakur2004
Mar 14th, 2006, 05:56 AM
as i attach the db pls open OrderHeader Form from this DB
now when i select the CustomerName from Combo Box then it show the related order of that customer, but if order is not place for that customer then it should show me blank record for that customer, but currently it is not show me that ....
help me regarding this ...

Any help would be greatly appreciated!

thanx and Regards,

KGComputers
Mar 16th, 2006, 02:07 AM
HI,,,


I have an attached DB that demonstrates simple searching...You may opt to modify it....However, this does not comply certain requirements for projects..However, this idea did help lot of my projects...

;) :) :) :)