Jimbojames30 Posted August 29, 2012 Posted August 29, 2012 Hi All, Please could someone help or advise me, i am building a database where i will be scanning barcodes into a table each product has two barcodes a product and a lot, all the products begin either 01 or A1 and lots always begin 17 or B2 In access i could validate with an after update event to check the information in the field began with 01 or a1 but how would i go about in file maker 12, just started to use it and have only attended a one day course which this wanst covered could someone please help me out?, i have been looking at this for ages and im sure it must be somthing i could use with the onobjectvalidate but yet again could be completely wrong? many thanks
Fitch Posted August 29, 2012 Posted August 29, 2012 Use a formula like: Let( entry = Left( barcode ; 2 ) ; entry = "01" or entry = "A1" )
Jimbojames30 Posted August 30, 2012 Author Posted August 30, 2012 Use a formula like: Let( entry = Left( barcode ; 2 ) ; entry = "01" or entry = "A1" ) Hi Fitch, thanks for your reply, is the to be placed in the validation by calculation, as i need it to check on exit of the field and not at when a new record is been created, i tried to put it in the onobjectvalidate but it doesn't have the Let function Also sorry never used LET my field Product do that relate you entry or barcode in your formula I managed to pull out the vba which i used in access, could anyone help me recrate this in script If Left([barcode], 2) = "+H" Or Left([barcode], 2) = "+M" Then Exit Sub Beep Cancel = True Me.Barcode.Undo End Sub
Fitch Posted August 31, 2012 Posted August 31, 2012 OnObjectValidate doesn't have any functions. It's a script trigger. You assign the trigger to the field to tell it when to trigger, and what script to run when triggered. Use the formula I supplied in the script, using the "If" script step. It's not critical to use the Let function, it just makes the calc a little more efficient. The script would look something like this: If [ Left( Barcode ; 2 ) = "+H" or Left( Barcode ; 2 ) = "+M" ] Exit Script Else Beep Exit Script [ Result:0 ] End If When you exit with a result of 0 (or "false") it stops the user's action that invoked the trigger, e.g. it keeps you from tabbing out of the field. 1
Jimbojames30 Posted September 2, 2012 Author Posted September 2, 2012 mate all i can save is "WOW" you have really helped my out big time i cannot thank you enough for this i have looked at me screen now for about 24 hrs at the same script !!!!! once again many thanks and thanks for your patience and understanding :yep: :yep: :laugh2:
Recommended Posts
This topic is 4522 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now