How to solve this.

richardplr

Registered User.
Local time
Today, 13:26
Joined
Jun 10, 2003
Messages
239
Hi.

I have a search field for multi-search which mean that you can either key in product code, product description or supplier code then you can find what you want).

After I get my data, I double click it to go to another form to show full details. (Here is my problem - when I double click it, sometime it will go to the exact field and sometime it wouldn't)

I have a few file in my attachment, inorder to get the correct form please see below the flow:

1. Go to form and click Search for Product Description

2. As it involve too many data, I have deleted some of the data so that I can zip it and attach here. Pls try other product if you see empty field at the another form. :p

Hope you can answer what I mean.
 

Attachments

in your Double_click procedure, I found that you open the same form 3 times with 3 different criterias. I do not know why you need to do it. To open a form with criteria, why don't you try the code structure below :

criteria = criteria1 OR/AND criteria2 OR/AND criteria3 OR/AND .....
DoCmd.OpenForm "formName", , , Criteria

Good Luck
 
Wild Horse said:
in your Double_click procedure, I found that you open the same form 3 times with 3 different criterias. I do not know why you need to do it. To open a form with criteria, why don't you try the code structure below :

criteria = criteria1 OR/AND criteria2 OR/AND criteria3 OR/AND .....
DoCmd.OpenForm "formName", , , Criteria

Good Luck

Sorry, I am very dump. I don;t understand what you mean.

What should I put for
criteria = criteria1 OR/AND criteria2 OR/AND criteria3 OR/AND ..... DoCmd.OpenForm "formName", , , Criteria

Can you should me the example on my attachment.
 
Since you are trying to open the same form 3 time with different criteria, i assumed that you need 3 criteria to open the form. with the logical relation ship AND, OR, etc, it is easier to do.
by the way, is it possible to search the data by product code, because i believe that the product code is unique for every product ? Give me time to see your database thoroughly.
 
Wild Horse said:
Since you are trying to open the same form 3 time with different criteria, i assumed that you need 3 criteria to open the form. with the logical relation ship AND, OR, etc, it is easier to do.
by the way, is it possible to search the data by product code, because i believe that the product code is unique for every product ? Give me time to see your database thoroughly.

Tks. wait for your good news
 
I think the problem is the product description data. is it true that the program was not working well when the product name contain the character such as #, ", &, ', etc. ?
 
Wild Horse said:
I think the problem is the product description data. is it true that the program was not working well when the product name contain the character such as #, ", &, ', etc. ?

Yes. You are right.
 
From one of my memo table form.

okholder = original memo data



Dim sql7 As String
AnyHolder = Replace(okholder, "'", "?")

If InStr(okholder, "'") > 0 Then
sql7 = "SELECT * FROM AllCHAPST WHERE AllCHAPST.Inspection like "
sql7 = sql7 & "'" & [AnyHolder] & "'"
Else
sql7 = "SELECT * FROM AllCHAPST WHERE AllCHAPST.Inspection like "
sql7 = sql7 & "'" & [okholder] & "'"
End If


'MsgBox sql7

Me.Form.RecordSource = sql7

Me.EditThisTask.Value = okholder
Me.Form.REFRESH



The idea is if your criteria has a funny character, replace it with a ? so it would skip one funny character.
 

Users who are viewing this thread

Back
Top Bottom