Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Zan1818 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    21

    Form displays "Expr 1002"


    Hello everyone,

    I have a question regarding a form I'm working on. You see, I'm creating a database for the vehicles in my company. One of the data included in the form is the "Current Mileage" of the vehicle. I just noticed that when I open the Design view of the form instead of displaying "Current Mileage" shows "Expr 1002". I believe that means the item is repeated but I don't have it anywhere else. I don't know if having it in another form could be causing the problem. Anyway, when I see the form in Form view, the numbers display correctly so I don't know if the "Expr 1002" is really affecting the form or if I could just ignore it. I would like to know how can I fix this or if it's something that won't affect it at all.

    Thank you

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Sounds like the query on which the form is based has a repeated field. Have you checked?

  3. #3
    Zan1818 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    21
    Quote Originally Posted by andy49 View Post
    Sounds like the query on which the form is based has a repeated field. Have you checked?
    Yes, I checked the table where the form is based from and everything is good. I don't know if maybe is something inside the form but I don't know how to check.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If you look at the properties of the field on the form, what does it say its Name and Control Source are?

  5. #5
    Zan1818 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    21
    Quote Originally Posted by JoeM View Post
    If you look at the properties of the field on the form, what does it say its Name and Control Source are?
    For name is shows "Current Mileage"
    For control source "Expr 1002"

  6. #6
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Go to the query it was based on, switch to SQL View, and copy and paste the SQL code here.

  7. #7
    Zan1818 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    21
    Quote Originally Posted by JoeM View Post
    Go to the query it was based on, switch to SQL View, and copy and paste the SQL code here.
    The form is based on multiple tables not queries.

  8. #8
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    The form is based on multiple tables not queries.
    Multiple tables? How do you do that without a query (unless you are using Subforms)?

    Does this "Current Mileage" field exists in more than one of the tables you are referencing?
    Do you have fields with this name in more than one place on your form?

    You may want to try removing the field from your form, and re-adding it and see if that fixes it.

  9. #9
    Zan1818 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    21
    Click image for larger version. 

Name:	Untitled.png 
Views:	15 
Size:	96.1 KB 
ID:	29262Click image for larger version. 

Name:	1.png 
Views:	15 
Size:	109.7 KB 
ID:	29263
    Quote Originally Posted by JoeM View Post
    Multiple tables? How do you do that without a query (unless you are using Subforms)?

    Does this "Current Mileage" field exists in more than one of the tables you are referencing?
    Do you have fields with this name in more than one place on your form?

    You may want to try removing the field from your form, and re-adding it and see if that fixes it.
    I just started a form from scratch by adding every button from different tables. I'm attaching two images so you can see how the form looks like.
    The Current Mileage field only exists in one table but I'm using it in two different forms. I didn't have this problem when I created both forms only when I added "caretaker" to the form is that I noticed the change. Again the numbers does display correctly on the form view but in the design view shows that.
    I already tried removing it and adding it again but when I saved the changes it changed back to Expr 1002, both the label and the text box.

  10. #10
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I just started a form from scratch by adding every button from different tables.
    Adding values from different tables to the same form without the use of a query? I don't even know how you would do that! What does it show the Control Source of the Form to be? It can only be a single object.
    Typically, if you want to combine fields from multiple tables into a single Form without using Subforms, you create a query to link and combine all the data you need into a single query. And then you use that as the Control Source of your Form.

  11. #11
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,412
    On the Maintenance Tracking form design view, what is the record source for the form on the data tab? If it's a query, run the query. You will see a field heading 'Expr1002'.
    If it's an SQL string, take a look at it and you will see some field or calculation followed by "As Expr1002".
    That's where it is coming from.

    Also, it's not good practice to have special characters in data names or object names. A slash "/" in a name could be interpreted as "Divided by".
    Last edited by davegri; 06-28-2017 at 10:36 PM. Reason: more

  12. #12
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    As has already been suggested, a Form based on multiple Tables has to have a Query as its Record Source...period! You may not have intentionally created a Query...but the Access Gnomes did when you started placing Fields from different Tables on your Form.

    Go to Properties - Data and copy what is in the Record Source Property and post it here.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  13. #13
    Zan1818 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    21
    So I checked the Record Source and it is a Query like Missinglinq said. Here is what it says:

    SELECT Mileage.[License No], Mileage.[Start Mileage FY], Mileage.[Current Mileage FY], Mileage.[End Mileage FY], [Air Filter Change].[Past Miles Checkup], [Air Filter Change].[Past Date], [Air Filter Change].[Next Miles Checkup], [Air Filter Change].[Next Miles Done], [Air Filter Change].[Next Date], Alignment.[Past Miles Checkup] AS [Past Miles Checkup_Alignment], Alignment.[Past Date] AS [Past Date_Alignment], Alignment.[Next Miles Checkup] AS [Next Miles Checkup_Alignment], Alignment.[Next Miles Done] AS [Next Miles Done_Alignment], Alignment.[Next Date] AS [Next Date_Alignment], [Belt Change].[Past Miles Checkup] AS [Past Miles Checkup_Belt Change], [Belt Change].[Past Date] AS [Past Date_Belt Change], [Belt Change].[Next Miles Checkup] AS [Next Miles Checkup_Belt Change], [Belt Change].[Next Miles Done] AS [Next Miles Done_Belt Change], [Belt Change].[Next Date] AS [Next Date_Belt Change], [Engine Tune-up].[Past Miles Checkup] AS [Past Miles Checkup_Engine Tune-up], [Engine Tune-up].[Past Date] AS [Past Date_Engine Tune-up], [Engine Tune-up].[Next Miles Checkup] AS [Next Miles Checkup_Engine Tune-up], [Engine Tune-up].[Next Miles Done] AS [Next Miles Done_Engine Tune-up], [Engine Tune-up].[Next Date] AS [Next Date_Engine Tune-up], [Fuel Filter].[Past Miles Checkup] AS [Past Miles Checkup_Fuel Filter], [Fuel Filter].[Past Date] AS [Past Date_Fuel Filter], [Fuel Filter].[Next Miles Checkup] AS [Next Miles Checkup_Fuel Filter], [Fuel Filter].[Next Miles Done] AS [Next Miles Done_Fuel Filter], [Fuel Filter].[Next Date] AS [Next Date_Fuel Filter], [Hoses Replacement].[Past Miles Checkup] AS [Past Miles Checkup_Hoses Replacement], [Hoses Replacement].[Past Date] AS [Past Date_Hoses Replacement], [Hoses Replacement].[Next Miles Checkup] AS [Next Miles Checkup_Hoses Replacement], [Hoses Replacement].[Next Miles Done] AS [Next Miles Done_Hoses Replacement], [Hoses Replacement].[Next Date] AS [Next Date_Hoses Replacement], [Lube, Oil, filter change].[Past Miles Checkup] AS [Past Miles Checkup_Lube, Oil, filter change], [Hoses Replacement].[Past Date] AS [Past Date_Hoses Replacement1], [Hoses Replacement].[Next Miles Checkup] AS [Next Miles Checkup_Hoses Replacement1], [Lube, Oil, filter change].[Past Date] AS [Past Date_Lube, Oil, filter change], [Lube, Oil, filter change].[Next Miles Checkup] AS [Next Miles Checkup_Lube, Oil, filter change], [Lube, Oil, filter change].[Next Miles Done] AS [Next Miles Done_Lube, Oil, filter change], [Lube, Oil, filter change].[Next Date] AS [Next Date_Lube, Oil, filter change], [Repack Wheel Bearings].[Past Miles Checkup] AS [Past Miles Checkup_Repack Wheel Bearings], [Repack Wheel Bearings].[Past Date] AS [Past Date_Repack Wheel Bearings], [Repack Wheel Bearings].[Next Miles Checkup] AS [Next Miles Checkup_Repack Wheel Bearings], [Repack Wheel Bearings].[Next Miles Done] AS [Next Miles Done_Repack Wheel Bearings], [Repack Wheel Bearings].[Next Date] AS [Next Date_Repack Wheel Bearings], [Service Brakes].[Past Miles Checkup] AS [Past Miles Checkup_Service Brakes], [Service Brakes].[Past Date] AS [Past Date_Service Brakes], [Service Brakes].[Next Miles Checkup] AS [Next Miles Checkup_Service Brakes], [Service Brakes].[Next Miles Done] AS [Next Miles Done_Service Brakes], [Service Brakes].[Next Date] AS [Next Date_Service Brakes], [Service Cooling System].[Past Miles Checkup] AS [Past Miles Checkup_Service Cooling System], [Service Brakes].[Past Date] AS [Past Date_Service Brakes1], [Service Cooling System].[Past Date] AS [Past Date_Service Cooling System], [Service Cooling System].[Next Miles Checkup] AS [Next Miles Checkup_Service Cooling System], [Service Cooling System].[Next Miles Done] AS [Next Miles Done_Service Cooling System], [Service Cooling System].[Next Date] AS [Next Date_Service Cooling System], [Service Rear Differential].[Past Miles Checkup] AS [Past Miles Checkup_Service Rear Differential], [Service Rear Differential].[Past Date] AS [Past Date_Service Rear Differential], [Service Rear Differential].[Next Miles Checkup] AS [Next Miles Checkup_Service Rear Differential], [Service Rear Differential].[Next Miles Done] AS [Next Miles Done_Service Rear Differential], [Service Rear Differential].[Next Date] AS [Next Date_Service Rear Differential], [Shocks Replacement].[Past Miles Checkup] AS [Past Miles Checkup_Shocks Replacement], [Service Rear Differential].[Past Date] AS [Past Date_Service Rear Differential1], [Service Rear Differential].[Next Miles Checkup] AS [Next Miles Checkup_Service Rear Differential1], [Shocks Replacement].[Past Date] AS [Past Date_Shocks Replacement], [Shocks Replacement].[Next Miles Checkup] AS [Next Miles Checkup_Shocks Replacement], [Shocks Replacement].[Next Miles Done] AS [Next Miles Done_Shocks Replacement], [Shocks Replacement].[Next Date] AS [Next Date_Shocks Replacement], [Tire Replacement].[Past Miles Checkup] AS [Past Miles Checkup_Tire Replacement], [Tire Replacement].[Past Date] AS [Past Date_Tire Replacement], [Tire Replacement].[Next Miles Checkup] AS [Next Miles Checkup_Tire Replacement], [Tire Replacement].[Next Miles Done] AS [Next Miles Done_Tire Replacement], [Tire Replacement].[Next Date] AS [Next Date_Tire Replacement], [Tire Rotation].[Past Miles Checkup] AS [Past Miles Checkup_Tire Rotation], [Tire Rotation].[Past Date] AS [Past Date_Tire Rotation], [Tire Rotation].[Next Miles Checkup] AS [Next Miles Checkup_Tire Rotation], [Tire Rotation].[Next Miles Done] AS [Next Miles Done_Tire Rotation], [Tire Rotation].[Next Date] AS [Next Date_Tire Rotation], [Transmission Service].[Past Miles Checkup] AS [Past Miles Checkup_Transmission Service], [Transmission Service].[Past Date] AS [Past Date_Transmission Service], [Transmission Service].[Next Miles Checkup] AS [Next Miles Checkup_Transmission Service], [Transmission Service].[Next Miles Done] AS [Next Miles Done_Transmission Service], [Transmission Service].[Next Date] AS [Next Date_Transmission Service], [Wiper Blades].[Past Miles Checkup] AS [Past Miles Checkup_Wiper Blades], [Wiper Blades].[Past Date] AS [Past Date_Wiper Blades], [Wiper Blades].[Next Miles Checkup] AS [Next Miles Checkup_Wiper Blades], [Wiper Blades].[Next Miles Done] AS [Next Miles Done_Wiper Blades], [Wiper Blades].[Next Date] AS [Next Date_Wiper Blades], Mileage.[Current Mileage FY], [Basic Information].Caretaker FROM ((((((((((((((((Mileage INNER JOIN [Air Filter Change] ON Mileage.[License No] = [Air Filter Change].[License No]) INNER JOIN Alignment ON Mileage.[License No] = Alignment.[License No]) INNER JOIN [Belt Change] ON Mileage.[License No] = [Belt Change].[License No]) INNER JOIN [Engine Tune-up] ON Mileage.[License No] = [Engine Tune-up].[License No]) INNER JOIN [Fuel Filter] ON Mileage.[License No] = [Fuel Filter].[License No]) INNER JOIN [Hoses Replacement] ON Mileage.[License No] = [Hoses Replacement].[License No]) INNER JOIN [Lube, Oil, filter change] ON Mileage.[License No] = [Lube, Oil, filter change].[License No]) INNER JOIN [Repack Wheel Bearings] ON Mileage.[License No] = [Repack Wheel Bearings].[License No]) INNER JOIN [Service Brakes] ON Mileage.[License No] = [Service Brakes].[License No]) INNER JOIN [Service Cooling System] ON Mileage.[License No] = [Service Cooling System].[License No]) INNER JOIN [Service Rear Differential] ON Mileage.[License No] = [Service Rear Differential].[License No]) INNER JOIN [Shocks Replacement] ON Mileage.[License No] = [Shocks Replacement].[License No]) INNER JOIN [Tire Replacement] ON Mileage.[License No] = [Tire Replacement].[License No]) INNER JOIN [Tire Rotation] ON Mileage.[License No] = [Tire Rotation].[License No]) INNER JOIN [Transmission Service] ON Mileage.[License No] = [Transmission Service].[License No]) INNER JOIN [Wiper Blades] ON Mileage.[License No] = [Wiper Blades].[License No]) INNER JOIN [Basic Information] ON Mileage.[License No] = [Basic Information].[License No];

    I'm using 18 tables I believe. I wasn't sure if it was alright to do it or not. So if there's a better way to still accommodate multiple tables in one form I will really appreciate if you could tell me.
    I'm barely learning Access at the moment

    P.S. I tried deleting the "/" from the name but didn't work.

  14. #14
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Search that SQL code for the actual name of the field, and see how many times it appears.

    Typically, what one does when working on a project like this is create the Query themselves first, that returns all the fields that they need. That way, you have control over what types of joins between exist between the fields, which fields are displayed, and any criteria you want on the records being returned.
    Then you create the Form with this Query as the Control Source.

    The fact that this generated query did all these joins for you tells me that you must have set up Table Relationships within your database.

    P.S. I tried deleting the "/" from the name but didn't work.
    You need to change it in the underlying Table directly.

  15. #15
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Note that is also possible that the field only exists once in your query, but multiple times on your Form.
    The way to look for it is to go to the Properties on the Form, looking for a field by that name, and select it from that list.
    It should take you right to where that field resides on the Form, so you can see where it is.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 07-07-2016, 12:22 PM
  2. Replies: 2
    Last Post: 03-04-2016, 04:32 PM
  3. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  4. Replies: 1
    Last Post: 02-05-2015, 05:41 PM
  5. Replies: 1
    Last Post: 09-03-2014, 03:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums