473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

#Name? Unknown Field

174 128KB
Hello,

I have a form with 1 unbound combobox and 2 unbound textboxes "I'll add a few more sets if I can get this working". I have 1 table "tbl_testingB"; the field names are listed in the code below. My problem is that when I make a selection in the combobox I get the #name? error "control can not be edited, its bound to a unknown field". The unknown field changes based on the combobox selection. Any help is appreciated.

Thanks

Expand|Select|Wrap|Line Numbers
  1. Private Sub cbo_equip_Change()
  2.     If cbo_equip = "Loader" Then
  3.         Me.txt_equiphours.ControlSource = "EquipmentHoursLoader"
  4.         Me.txt_equipfuel.ControlSource = "EquipmentFuelLoader"
  5.     ElseIf cbo_equip = "Skid Steer" Then
  6.            Me.txt_equiphours.ControlSource = "EquipmentHoursSkidSteer"
  7.            Me.txt_equipfuel.ControlSource = "EquipmentFuelSkidSteer"
  8.     ElseIf cbo_equip = "Water Truck" Then
  9.            Me.txt_equiphours.ControlSource = "EquipmentHoursWaterTruck"
  10.            Me.txt_equipfuel.ControlSource = "EquipmentFuelWaterTruck"
  11.     ElseIf cbo_equip = "Wash Down" Then
  12.            Me.txt_equiphours.ControlSource = "EquipmentHoursWashDown"
  13.            Me.txt_equipfuel.ControlSource = "EquipmentFuelWashDown"
  14.     ElseIf cbo_equip = "Other" Then
  15.            Me.txt_equiphours.ControlSource = "EquipmentHoursOther"
  16.            Me.txt_equipfuel.ControlSource = "EquipmentFuelOther"
  17.     Else
  18.     End If
  19. End Sub
  20.  
Looking around the web I had tried adding the below info with no luck.
Expand|Select|Wrap|Line Numbers
  1. 'Dim db As DAO.Database
  2. 'Dim rs As DAO.Recordset
  3. 'Set db = CurrentDb
  4. 'Set rs = db.OpenRecordset("tbl_testingB", dbOpenDynaset)
  5. 'Dim frm As Form
  6. 'DoCmd.OpenForm "frm_testing"
  7. 'Set frm = Forms!Testing
  8.  
Mar 14 '19
78 3577
williamson1979
174 128KB
Below is my current issue and a brief description of tables.

tblAsphalt2 does not update field FKAsphalt2 in table tblPlantReport automatically...

I have the qry/rpt semi working now. But I have to add the ID to field FKAsphalt2 manually so something is wrong. I have it setup the same as all the tables directly linked to tblPlantReport. Maybe this is the reason>>> tblAsphalt1 and tblAsphalt2 share tblAsphaltCorr & tblAsphatSpecificGr and they are accessed with vba. Ive listed below what each table is for. From everything I've be told by you and others long tables are bad so Ive broken the tables down as I would file document folders in a cabinet.

tblPlantReport is how I joined all the product/process tables together in relationships. Basically as a container.

tblProduction is a summary of production time and rate of production. This could be expanded to be more specific.

tblEnviromental is weather conditions and temperatures. tblEnviromentalCond stores weather conditions. Minor tweaks possible.

tblFuel is a summary of the fuel used during production. This could be expanded to be more specific.

tblAsphalt1 and tblAsphalt2 is for calculating how much was used. tblAsphalt1Chart and tblAsphalt2Chart converts inches measurement to gallons. tblAsphaltSpGravity and tblAsphaltCorr are used to convert the gallons to gallons @ 60 F. tblAsphaltGrade stores different grades of the product. Expansion not likely.

tblLime is a summary of this product used in production. Minor tweaking possible.

--------------------------------------------------------------
Every table with the exception of tblEnviromental are dependent on tblProduction for the field txtTotalTon to calculate each products percent of the total.
Mar 26 '19 #51
twinnyfo
3,653 Expert Mod 2GB
I guess I am not being clear. What one thing do you want us to address?
Mar 26 '19 #52
williamson1979
174 128KB
As prior post I want to address why tblAsphalt2 does not update its ID in tblPlantReport.FKAsphalt2

The other was simply a summary of what things were because you said you needed more info on the structure or why I had tables a certain way.
Mar 26 '19 #53
twinnyfo
3,653 Expert Mod 2GB
1. Don't use the actual SQL string as the Record Source for Form. There are no problems with doing this, but it is much easier to create a Query, save it and use the query itself as a Record Source.

2. If you look at your SQL string in Design view, you will notice that tblAsphalt2 has a relationship to AsphaltFK1. I don't think this is what you want.

3. Why two tables for Asphalt which contain identical information? Again, this is exactly the same principle that we've talked about with your very first thread: One table, multiple records.

There is way more I can talk about this design, but the above will get you working with your Asphalt. But again, you've made wholesale redesigns without knowing the direction you needed to go.
Mar 26 '19 #54
williamson1979
174 128KB
SQL statement... So access must just generate that automatically. So I remove the source from the form followed by adding my query with all the data as the record source. Sound correct?

Far as the redesign... from our previous communication it seemed to me that I was incorrect by having the long table. So it seemed only logical to break up the different materials and processes into individual tables.

Far as two asphalt tables... I guess I have no reason why other than it seemed cleaner.

If I have understood about the record source correctly could you give me insight on the design you mentioned please?
Mar 26 '19 #55
twinnyfo
3,653 Expert Mod 2GB
Correction:
Far as the redesign... from our previous communication it seemed to me that I was incorrect by having the long table. So it seemed only logical to break up the different materials and processes into individual tables.
Just the opposite. You have many tables because tall tables are better than wide tables--although a wide table is not "necessarily" bad--it just depends on what data you are keeping.

=========================

Problem (and this is neither nit-picking nor eye-poking): I think you have a very general misunderstanding or lack of understanding about basic DB prinicples of table design and structure. We've all been there, so try not to be offended. A corollary of that is that folks often try to start building their forms and reports and output products before they have figured out how things are to be designed first. Then to fix the form or report that doesn't work because things are broken, they try to change something else which breaks something else, and now something else which used to work (by some miracle) now no longer works and they try to rearrange something else (or everything else) and turn the crank and are amazed that now, nothing works. Again: we've all been there at some point--especially if we are self-taught.

So, let me talk broad strokes, big picture, 30,000-foot view and describe what you ought to be thinking about for your DB.

First, what are you really keeping in your DB? A series of production runs, yes? So, your [highlight5]MAIN TABLE[/highlight], upon which pretty much everything else (somehow) should be related is tblProduction.

That table should have the basic information about that particular production run: date, operator, start time, stop time, etc. For the most part, I think you have this.

What you don't have is tables that are properly related to that main table. I will use the Aggregate table from one of your earlier threads, because "I thought" we had gone over this and "I thought" you understood the principle and "I thought" you would have gradually implemented that same principle into the rest of your DB design. However, I find it incredibly odd that the one thing that "I thought" we had working is conspicuously absent from the current DB.

SO, using the principle of the Aggregate, you have up to 10 different types of aggregate (with Percent, used and recieved for each). Rather than using 30 additional fields for your production table--which was your initial design--we broke all the aggregate out into a separate table of only a few fields: ProdID, AggType (because we made a spearate table for that) and then Percent, Used and Received. Notice how the ProdID was the foreign key in the table.

So, use that as your paradigm for your Lime table--just as an example. Let's use two scenarios:
1) You always use lime in every production. You only add it once for any production (I still don't know what the Starting, Ending, Used, Received, Percent means, but it is immaterial, because it should matter at this point). In this scenario, you "could" add all these fields to tblProduction. Remember, this is jsut a scenario.

2)You may (or may not) add lime to your production OR you may add lime several times during a production run OR you may add it every time, but only once. In this scenario (which, by the way, includes the first scenario), it is best to have a separate table for Lime, simply because it gives you greater flexibility in your Lime management (and if you had "Lime reports" you could do essentially all that from one table).

Now, if you are going to have a lime table, based upon the paradigm of the Aggreaget table--which worked--how would you go about designing that table and its appropriate relationship to tblProduction?

ProdID, LimeBlah1, LaimeBlah2, LimeBlah3, etc.

Do you see how ProdID is always the FK in all the tables directly descended from your production activity? In the end, tblProduction (when you view all your relationships) begins to looks like the center of a spider web, with all the other tables coming off that one table, many of which are related via ProdID.

This is big picture stuff, and this is how you need to start thinking about your DB.

But don't just take this advice and change every table all at once. You need to understand these principles first, then once the table structure is built for one aspect of your design, now try to create a form that will work with this design. As I mentioned to you earlier, a Tab Control is a good design for this: You've done that. BUT, each Page on that tabl control should have sub-form specific to each particular aspect of the production. One subform will be about Lime, one about Aggregate, etc.

ONE


STEP


AT


A


TIME.
Mar 26 '19 #56
williamson1979
174 128KB
So lime is not always used so it has its own table. Also asphalt1 and asphalt2 fall in line with lime because both asphalt tanks may or may not be used the same production run.

Far as FK always being productionID that seems a quick fix. But when I tried using ID I could not force set update in the relationships so I made fields. So while it might be incorrect that was why I did that.

Starting, Ending, Received or similar verbiage is just on hand inventory to start production and after production. Received is just what was added during production.
Mar 26 '19 #57
williamson1979
174 128KB
Before I get off topic. So remove tblPlantReport, FK related tables to tblProduction. If a material is not always included such as lime it has its on table. Fields from tblProduction will go directly to my form. Fields from related tables insert into the tabs as sub forms.

This what I need to work on currently to fix what I already have correct?
Mar 26 '19 #58
twinnyfo
3,653 Expert Mod 2GB
Far as FK always being productionID that seems a quick fix. But when I tried using ID I could not force set update in the relationships so I made fields. So while it might be incorrect that was why I did that.
I have no idea what you are talking about here.

Plus, creating a well-designed, fully normalized database is never a quick fix. It is proper design.

This what I need to work on currently to fix what I already have correct?
My assessment is that very little is correct with your current DB.

AND, you're talking about asphalt, starting, ending and receiving again. One step at a time.

Do you understand that you must understand what you are doing before you can move on to anything else?
Mar 26 '19 #59
williamson1979
174 128KB
I understood that my relationships need to be created from tblProduction. So if that is the case then I need to remove tblPlantReport entirely.

Once that has happened and my table relationships are created from tblProduction’s PK to the related tables I would then create subforms and insert into the tabs on my form.

I only mentioned starting and ending because you had said you had no idea what they were for so no question or conversation there just simply answering what I took as a question. Maybe I over think statements but if you aren’t sure what something is I try to at least briefly state what it is in the case it matters to structure.

So if I do the above steps for now would that have it falling back in-line far as being correct?
Mar 26 '19 #60
williamson1979
174 128KB
Do you see how ProdID is always the FK in all the tables directly descended from your production activity?

This is corrected now.

------------------------------------------------------------------
If you look at your SQL string in Design view, you will notice that tblAsphalt2 has a relationship to AsphaltFK1. I don't think this is what you want.

This is corrected now and tblAsphalt2 is updating automatically.
-------------------------------------------------------------------
1. Don't use the actual SQL string as the Record Source for Form. There are no problems with doing this, but it is much easier to create a Query, save it and use the query itself as a Record Source.

I have not switched the record source yet, before doing so I'm curious if my data will still be saved in the tables as well.
--------------------------------------------------------------------
As I mentioned to you earlier, a Tab Control is a good design for this: You've done that. BUT, each Page on that tabl control should have sub-form specific to each particular aspect of the production. One subform will be about Lime, one about Aggregate, etc.

I will do work on this tomorrow, very simple layout I use so should not take long. But this brings me back to you saying use query as a record source, so every subform will use a individual qry or can I use my qry that has every table/every field for each subform?
--------------------------------------------------------------------
Just curious here, not requesting details for now. I never could recreate your aggregate subform. Did you use a query for its source to filter it to the forms date?


Thanks, This is a big learning curve. I'm semi getting it I do believe but without tech knowledge/terminology its sometimes difficult to get what I'm asking across in a way it makes sense.
Mar 27 '19 #61
twinnyfo
3,653 Expert Mod 2GB
Lots and lots of stuff.

One step at a time. Don't go changing everything right now.

OK - if you've never been able to get the Aggregate to work then this thread is moot.

Get that working first. But, I am absolutely clueless as to how it does not work, as I provided a working sample DB.

One step at a time.
Mar 27 '19 #62
williamson1979
174 128KB
When I put the sum function it just made the waiting icon for Windows circle. In the footer I made a unbound box, added sum() with the used and received fields. That’s why I ask if you used query because I used table. But that was just a yes or no. Not looking for great details here now.

My main concern is table structure. You said that was wrong. I corrected what you listed yesterday with the exception of subforms. I’ll do that today.
Mar 27 '19 #63
twinnyfo
3,653 Expert Mod 2GB
Again - look at the samble DB I created and posted for your Aggregate. If you had, you would see that it is a query--which is required, because we need values found in the Production Table.

If you can't get the aggregate to work yet, and don't understand what we are doing with that aspect of your DB, I wouldn't go changing other things.

Do you understand that I want to help you understand what you are doing? I want you to be able to see what is going on so that you can apply those same principles to other aspects of your DB.
Mar 27 '19 #64
williamson1979
174 128KB
I thought it must have been a query. I just don’t have the file on this pc. So I think with that I can recreate it. I had everything else with it looking correct. I did look at it when you sent it. I tried to recreate it myself rather than just use yours so I actually know how it works.

But from your previous post I think my tables and relationships need to be right before adding that into the dB. So I want to focus on that. Wouldn’t you agree?

So I’ve put ProductionID relationship to FK fields I added in each related table. I believe this is correct with what you posted yesterday.

Table structure. I understand I do not want to duplicate data. The only tables I kind of disagree with is my asphalt tables. Using the logic you posted about if a material is used everyday or not. Each asphalt tank can contain a different grade material and more likely than not only one will be used per production day.

Also from our previous post I’d like to expand to add more information so seems logical to give each ingredient a table rather than re work “combined” data tables later.
Mar 27 '19 #65
twinnyfo
3,653 Expert Mod 2GB
Let meknow when you have the Aggregate figured out and working properly.
Mar 27 '19 #66
NeoPa
32,556 Expert Mod 16PB
I'd jump in but I can see you're getting the best help possible already Williamson.

Stick with it and trust the guidance you get. Like being on a roller-coaster. It can be scary at times but you can learn to relax if you know you're in good hands that are ready to redirect you if you go astray.
Mar 28 '19 #67
williamson1979
174 128KB
Yeah it’s tough. Still wrapping my mind around things. Learning enough to create more mistakes. I guess that’s how you learn though.
Mar 28 '19 #68
NeoPa
32,556 Expert Mod 16PB
Actually, you're probably far better off being disciplined about it and taking one clear step at a time, but I understand that's very difficult for many people. It's the easiest and least frustrating route through any learning process but seems nevertheless to be beyond most people (Not just you by any means).

Obviously I recommend that approach, but nobody here will criticise if you do it the normal way and blunder through trying the next step before you've got the earlier ones properly mastered. Learning can be exciting and of course you want to see where your new understanding will get you. Normally that's the equivalent of mildly cracked shins, but we do it because we love it, and most of us can deal with cracked shins from time to time. We can enjoy the journey even if it isn't smooth and comfortable all the time.
Mar 28 '19 #69
williamson1979
174 128KB
I’ve definitely got a better understanding but I’ve always learnt new things by trial and error. Which isn’t always the most practical way. I know I’m driving twinny insane. I think the biggest obstacle at the moment is my lack of proper terminology. It’s really hard for me to get what I want to say across in a way that makes sense. What I’m needing it for makes perfect sense to me but to someone reading I’m sure it makes as little sense to them as this sql/vba makes to me.

I know access screws up the sql statements pretty easy once I try to make changes. So I did learn to look at that once something “stops” working as it was or asking parameters. So twinny you did get something into my brain.

But anyway everyone here has been great. Even if I still have aspects of my dB incorrect I’ve still learned things I didn’t know.
Mar 28 '19 #70
williamson1979
174 128KB
Twinny. Soon as I add the calculated fields to the query it stops working. By stopping working it displays no data. I copied what you did. I’ve triple checked that I did not mistype the field names.

Agg table ID as interger. Both agg ID and aggType set as PK. Production relationship enforced to agg ID

Subform set as continuous, main form single. I have the labels in the header, data handling boxes in the body and sum boxes in the footer. I edited parameters so it displays as your example with the exception you edited the default color, font.

I do not see any unrelated info in the sql in query view.

Any ideas?
Mar 28 '19 #71
williamson1979
174 128KB
I’ve never had issues with queries before but this is the first using 2 tables so there’s a obvious step that I did not notice in your example I’m assuming.
Mar 28 '19 #72
NeoPa
32,556 Expert Mod 16PB
I'm going to make a quick suggestion here.

Take your current SQL that isn't working as you've just described. Rip out as much as you can that doesn't affect the problem. We want to see the problem itself, and as little else as we can get away with. Format what you have so that it's legible and then include it in a post that describes as clearly as you can what is wrong with it.

We don't need to work on a big complicated query if we don't have to. This is often a great technique to use whenever you have problems. Strip it down to the bare essentials without losing the essence of what's wrong. Format it so that it's legible. With this you have something you can work on without all your attention being focused on looking at elements that are irrelevant and without having to work so hard at reading what you're looking at.

Sharing it here also allows us to look at it in the same way. With more experience we may be able to help. I often find that once someone has gone through that process though, they understand what the problem is without further guidance.
Mar 28 '19 #73
twinnyfo
3,653 Expert Mod 2GB
Your Query should look something like this:
Expand|Select|Wrap|Line Numbers
  1. SELECT tblAggregate.ProdID, 
  2.        [PaidTons]+[WasteTons] AS TotalTons, 
  3.        tblAggregate.AggType, 
  4.        tblAggregate.AggU, 
  5.        [AggU]/[TotalTons] AS AggP, tblAggregate.AggR
  6. FROM tblProduction 
  7. INNER JOIN tblAggregate 
  8. ON tblProduction.ProductionID = tblAggregate.ProdID;

Attached Images
File Type: jpg Williamson01.jpg (91.8 KB, 402 views)
Mar 28 '19 #74
williamson1979
174 128KB
OK I have the subfrm aggregates Calculating now. I had to link master and child. So that was my problem.
Mar 28 '19 #75
williamson1979
174 128KB
Neo I'm not sure I understand this enough yet to remove stuff not related to the problem but I can try in the future.
Mar 28 '19 #76
williamson1979
174 128KB
Now that I'm corrected on that what should I do next? If I list what I want to store would the next best step be setting up sound tables and relationships?
Mar 28 '19 #77
twinnyfo
3,653 Expert Mod 2GB
Because this particular thread is length, wieldy and much off topic, I recommend you do this:
  • You've got the Aggregate working as intended, yes?
  • Use what you have learned to work with the Lime.
  • Use the same principles, remembering what you've learned, trying not to make the smae mistakes.

If you run into specific problems, create a new thread, explaining the specific problem and we will try to work through that with you.
Mar 29 '19 #78
williamson1979
174 128KB
Ok I’ll start a new one. I really just want to put out what days I want and how I think the tables should be. Then get some feedback
Mar 29 '19 #79

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Richard | last post by:
I need to dynamically add (but not remove) vectors of doubles based on keys/names. Please see my code below. Am I reinventing the wheel or doing anything inefficiently? I get the feeling that I am,...
4
by: Oak Hall | last post by:
I have a several tables the primary index field name in different in each one, how do I query with a 'where "column 1" = 3' if I do not know the name of that column only that it is the first...
0
by: SiRkNiGhT115 | last post by:
Hello, I am new to MS Access and I am trying to do a database for work just for a school project. I am trying to step up a database for our inventory but I am trying to setup a employee Id box so...
0
by: Matt | last post by:
Have sql return 2 rows 2 columns Column A Column B 123 abc 234 cde Cant get the Column names and column values any help? do i need to loop objRead or...
0
by: b_madhubharathi | last post by:
hi frnz, In my coding i take the tablename and columns from the system and i execute the new query with that values. if i give the table name directly it is working.but if i give the table in...
5
by: devx777 | last post by:
Hello, I am trying to find some information or an example on how to build a dynamic query in DB2 that would allow me to join a table which its name is stored as a field value on another table....
0
by: Charles | last post by:
I receive weekly updates via a download file for an application written in VB.NET 2003. The file is delimited by "|" (single pipe) and I currenly have a format file setup to update my data in one...
8
by: ldndude | last post by:
Heya, I think I shot myself in the foot when I set this up Overview: I have a dynamically generated page for listing pictures for a project I am working on for my boss. To put it simply...this...
4
by: KrazyKasper | last post by:
I'm a Novice User using Access 2003 Tables are via ODBC (i.e., cannot alter fields) I have a report that uses the field OrderRepName (text string) and is formatted as lastname, firstname,...
7
by: samvb | last post by:
I been staring and editing the codes for hours...I cant seem to understand it at all. I want to login basically. I have a mysql stored procedure in this way: CREATE DEFINER=`dan78`@`localhost`...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.