Hello Access-programmers!
It is my first time posting here, so bare with me if I do anything wrong.
I am currently working on a database for the company I am working for. The idea behind this is to store informations on products we have at customers around europe.
These products will have a servicecontract and I have therefore made a calculation of "LastService" + "MonthlyInterval" = "NextService" it looks like this in the Query:
LastService: IIf(IsNull([LastService]);[BisDatum];IIf(IsNull([MonthlyInterval]);[BisDatum];DateAdd("m";[MonthlyInterval];[LastService])))
This will ask me for the latest date the service should be on all of the products in my list and works very well, the report shows the products within the dates.
HOWEVER
I also have a searchfield with a connected button:
This might seem alittle messy but actually works fine, it allows me to search for information in each of the fields I have in my Form with listed products at the chosen customer.
However if I search for product "AGOL" and then press the reports button I want it to show ONLY "AGOL" products within the Date Scale I chose. Is this possible?
I hope you understand what I am trying to tell you. Else I will try to explain as well as I can!
Kind Regards,
Anders Iskov
It is my first time posting here, so bare with me if I do anything wrong.
I am currently working on a database for the company I am working for. The idea behind this is to store informations on products we have at customers around europe.
These products will have a servicecontract and I have therefore made a calculation of "LastService" + "MonthlyInterval" = "NextService" it looks like this in the Query:
LastService: IIf(IsNull([LastService]);[BisDatum];IIf(IsNull([MonthlyInterval]);[BisDatum];DateAdd("m";[MonthlyInterval];[LastService])))
This will ask me for the latest date the service should be on all of the products in my list and works very well, the report shows the products within the dates.
HOWEVER
I also have a searchfield with a connected button:
PHP:
Private Sub Kommandoknap32_Click()
Dim strsearch As String
Dim strText As String
Dim Kunde As String
Kunde = Right$(Me.Filter, Len(Me.Filter) - 10)
If (Len(txtsearch.Value) > 0) Then
strText = Me.txtsearch.Value
strsearch = "SELECT * from ProduktListeQ where (KundeId like " & Kunde & " AND ((ProduktNavn like ""*" & strText & "*"") or (TypeNummer like ""*" & strText & "*"") or (HøjreVenstre like ""*" & strText & "*"") or (SerieNummer like ""*" & strText & "*"") or (IntervalMåneder like ""*" & strText & "*"") or (Kunden like ""*" & strText & "*"")))"
Me.RecordSource = strsearch
Else
strsearch = "SELECT * from ProduktListeQ where (KundeId like " & Kunde & ")"
Me.RecordSource = strsearch
End If
End Sub
This might seem alittle messy but actually works fine, it allows me to search for information in each of the fields I have in my Form with listed products at the chosen customer.
However if I search for product "AGOL" and then press the reports button I want it to show ONLY "AGOL" products within the Date Scale I chose. Is this possible?
I hope you understand what I am trying to tell you. Else I will try to explain as well as I can!
Kind Regards,
Anders Iskov