Marcel2586
Registered User.
- Local time
- Yesterday, 19:55
- Joined
- Mar 1, 2012
- Messages
- 41
Hello,
I have a question about errors on null value.
I have made a small database for tryout, it has to be implemented in another one.
And the small database is working.
I have one table where there is one field called BatchInput.
I scan a barcode into it and let two query’s breaking it apart.
I scan this batch into the table field BatchInput:
20 MAY 2004H149-082-79 A4147011A05
Then I have my first query (Qrybreak1) extracting the date and deleting H14
Date: Left([BatchInput];11)
PartCertNr: Right([BatchInput];Len([BatchInput])-14)
The result is this:
Field date: 20 MAY 2004
Field PartCertNr: 9-082-79 A4147011A05
the second query (Qrybreak2) I look for the first space:
space: InStr([PartCertNr];" ")
then with the result I cut it into two pieces
PartNumber: Trim(Left([PartCertNr];[space]-1))
CertNumber: Trim(Right([PartCertNr];[space]+2))
Resulting into:
Field Partnumber: 9-082-79
Field Certnumber: A4147011A05
Then I have a third query (QryResult) where all is built together:
Field Date: 20 MAY 2004
Field PartNumber: 9-082-79
Field CertNumber: A4147011A05
This works great. (very happy)
But then I have a barcode without a Certnumber, then everything grinds to a halt.
014-11-2000 H14137-00-277-69FS
Giving me one error on the query (Qrybreak2) #Func!
And query (QryResult) even won’t start, giving a popup with “Invalid procedure call”
How could I handle Null on the part where there is no space after the partnumber (missing Certnumber)?
I have a question about errors on null value.
I have made a small database for tryout, it has to be implemented in another one.
And the small database is working.
I have one table where there is one field called BatchInput.
I scan a barcode into it and let two query’s breaking it apart.
I scan this batch into the table field BatchInput:
20 MAY 2004H149-082-79 A4147011A05
Then I have my first query (Qrybreak1) extracting the date and deleting H14
Date: Left([BatchInput];11)
PartCertNr: Right([BatchInput];Len([BatchInput])-14)
The result is this:
Field date: 20 MAY 2004
Field PartCertNr: 9-082-79 A4147011A05
the second query (Qrybreak2) I look for the first space:
space: InStr([PartCertNr];" ")
then with the result I cut it into two pieces
PartNumber: Trim(Left([PartCertNr];[space]-1))
CertNumber: Trim(Right([PartCertNr];[space]+2))
Resulting into:
Field Partnumber: 9-082-79
Field Certnumber: A4147011A05
Then I have a third query (QryResult) where all is built together:
Field Date: 20 MAY 2004
Field PartNumber: 9-082-79
Field CertNumber: A4147011A05
This works great. (very happy)
But then I have a barcode without a Certnumber, then everything grinds to a halt.
014-11-2000 H14137-00-277-69FS
Giving me one error on the query (Qrybreak2) #Func!
And query (QryResult) even won’t start, giving a popup with “Invalid procedure call”
How could I handle Null on the part where there is no space after the partnumber (missing Certnumber)?