just edit button

AHMED KHALAF

Registered User.
Local time
Yesterday, 16:35
Joined
Feb 13, 2008
Messages
20
HI ALL
I have an edit button in a form. but I do not know how to find matching value from unbound combo box to bound combo box.
I attached form ( f_unique) and described what I need on it
thanks
 

Attachments

You can use the contents of your combo boxes as criteria in a query try;

Code:
Forms!FormName!ComboName

FormName will be the name of your form f_unique
ComboName will be the name of the combo and should relate to field it is the criteria for.
 
You can use the contents of your combo boxes as criteria in a query try;

Code:
Forms!FormName!ComboName

FormName will be the name of your form f_unique
ComboName will be the name of the combo and should relate to field it is the criteria for.

FIRST THANKS FOR YOUR REPLY
MAY YOU EXPLAIN TO ME WHAT I HAVE TO DO. BECAUSE I DO NOT KNOW WHAT YOU MENTION ABOVE
THIS IS PHOTO OFF WHAT I NEED. :D:D:D

 
Last edited:
Your query Q_Filter currently has;

Code:
[Forms]![F_UNIQUE]![CO_PROJECT].[VALUE]

add
Code:
[Forms]![F_UNIQUE]![CO_filter]
in the criteria for requisition.

You can now use this query as the record source for a form or whatever, and it should work for you.
 
You might also want to be consistent with the implementation of your naming protocol.
 
Sorry for disturbance
but i did . What you say before but it doesn't work with me
so may you make it and send it to me
 
I do not know how to find matching value from unbound combo box to bound combo box.

One simple answer to your question is:

Code:
Private Sub Command33_Click()
Me.CO_REQUISITION = Me.CO_FILTER
End Sub

The problem here is that your combobox CO_Requistion is bound to a query which is NOT Updateble, so you cannot set a value to this field. Make the query updateble before you move on.

JR
 
One simple answer to your question is:

Code:
Private Sub Command33_Click()
Me.CO_REQUISITION = Me.CO_FILTER
End Sub

JR

THANKS
I DID WHAT YOU SAID BUT IT GAVE ME THIS MESSAGE





The problem here is that your combobox CO_Requistion is bound to a query which is NOT Updateble, so you cannot set a value to this field. Make the query updateble before you move on.

JR

NO THE COMBO BOX BUND TO QUERY BU IT IS UPDATEBLE I TRAY IT BEFORE
 
Last edited:
I've just been trying to get this working but have run into a problem, in that you are using combo box lookups at table level. Please read the article in this link, I would then suggest you redesign your tables. Unfortunately this may mean starting again from scratch.
 
I FOUND CODE AND IT WORK VERY GOOD
BUT SOME TIMES IT GAVE'S ME AN ERROR


Code:
Private Sub Command40_Click()
Dim strCustomerRef As String
Dim strSearch As String
If IsNull(Me![CO_FILTER]) Or (Me![CO_FILTER]) = "" Then
MsgBox "Please enter a value!", vbOKOnly, "Invalid Search Criterion!"
Me![CO_FILTER].SetFocus
Exit Sub
End If
DoCmd.ShowAllRecords
DoCmd.GoToControl ("CO_REQUISITION")
DoCmd.FindRecord Me.CO_FILTER
CO_REQUISITION.SetFocus
strCustomerRef = CO_REQUISITION
CO_FILTER.SetFocus
strSearch = CO_FILTERH
If strCustomerRef = strSearch Then
CO_REQUISITION.SetFocus
CO_FILTER = CO_FILTER
End If
End Sub
 
There is one site told me that i have to remove the (docmd.showallrecoed)
because it remove any filter in the form
but i do not know what i have to do.
Instead of that

thanks
 
please if any one know how to resolve this problem just tell me
I'll appreciate
this issue is a big headache to me
 
It's work but some times gave an erorr
i already attached the file
all i need how to resolve this problem
 

Attachments

I know the reason now so.
Is there any code to empty the existing value ? in ( co_requisition ) with the knowledge that the (co_requisition) is bound combo box and can't have null value .
The file attached

And the reason is that when I select project and select the number of the project then when I'm pressing on the editing button then it gives me the value that I want and also added the last value in the ( co_requisition) to this project
 

Attachments

Ok is ther any code in vba like
selectedindex = -1

i think this will be the solution
 
Last edited:

Users who are viewing this thread

Back
Top Bottom