Hi There - You are right. Access db formatting gets the right number of digits on submission but it doesn't appear on the InfoPath query form. The form takes actual number with no leading zero if you try to view it in any way either by text box or expression box. Interestingly, the Access report view takes the formatting with the leading zeros which was my prediction that it would work for InfoPath query form as well. You can run a query using another text field that will take values from this field with added sets of rules.
Say for example, you've created ID field in the Access db AutoNumber and getting number such as ...., 7, 8, 9, 10, 11. It doesn't matter whether you've formatted in db or not. It also doesn't matter whether you show it on your input form or not. Because this ID field as AutoNumber will get its value in db automatically. To view the ID field in the desired format, you can create another field. Say this is ID_F. Note that as a requirement that this field is to be in the Access db.
In text box properties dialogue box of the ID_F: Data tab: Value fx box will be @ID. Click the Rules button and set the rules as follows:
Rule 1: Condition: ID < 10 and Action: =fx Set a field's value, Field: . , Value: concat("000000000", @ID) or whatever the number of zeros required.
Rule 2: Condition: ID >= 10 and Action: =fx Set a field's value, Field: . , Value: concat("00000000", @ID). There is one zero less as the ID digit is increasing by one digit.
And so on.
You can add comma if you want.
I would prefer to make the field read-only on Display tab of the text box properties dialogue box.
Thanks,Ash