473,669 Members | 2,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

#Name? Unknown Field

174 New Member
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_testin gB"; 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 3642
twinnyfo
3,653 Recognized Expert Moderator Specialist
I do like the way the data is cleaner and easier to query this design so far but it makes it more complex "connecting " the data for someone as myself that is learning on the fly.
It can. But as you understand your structure better, you will be able to execute those reporting options easier over time, and you will have greater flexibility in the long run.
Mar 15 '19 #11
williamson1979
174 New Member
I really like the way the data is stored but can I have the calculations form request the data from those tables or a query? Example: tblEquipment records where the fuel was used and amount; tblreport has the fuel tank starting amount, received amount so it needs to know fuel used from tblequipment or the ending amount. So without putting 2 similar but different items together in 1 table how do I get all the numbers to my main calculation form? Sorry for all the questions.
Mar 15 '19 #12
williamson1979
174 New Member
I tried to do as you stated on the equipment also adding the 3rd table. I did not get any error messages though. Maybe I did something wrong.
Mar 15 '19 #13
williamson1979
174 New Member
So Twinny something like below is what you wee saying I think. How would I tie all three together properly? If I get this figured out then I believe my aggregates or any tracking I added would fit in this design. Thanks


Tables
--------------------------------------------------------
Equipment
tblEquipId EquipID EquipNum
tblEquipType EquipTypeID EquipType
tblEquipUsage EquipUsageID EquipDate EquipHours EquipFuel

Queries
----------------------------------------------------------
Equipment
qryEquipSum Date Type Number Hours Fuel

Form
----------------------------------------------------------
frmEquipmentsub "display datasheet, current record only"

Date:Date() EquipType:Ldr EquipNum:L73 EquipHours:600. 3 EquipFuel:50
Mar 16 '19 #14
twinnyfo
3,653 Recognized Expert Moderator Specialist
I’ll try to look at this tomorrow
Mar 17 '19 #15
williamson1979
174 New Member
Thanks.

Question 1 - Basically what I posted prior. A main table "usage" linked to a table "type equip" and also linked to a table "equip num" with relationships to keep integrity, cascade update correct?


Question 2 - Being as I have tables to store the equipment type and equipment number is there a easy way to add new from the combobox. I do have some vba code but requires the table to be open.


Question 3 - Can the appearance of the datasheet view be modified? It opens enough space for 3 times the fields I actually have so basically much wider than needed.


Question 4 - Once I complete all my table sets such as Equip, Aggregate and so on how do I "join" the tables or join them in a query so that my report generates everything from the same date. I know you used some vba but I didn't really understand how it worked.
Mar 17 '19 #16
williamson1979
174 New Member
OK Twinny, I deleted the last upload. This one is a good bit further along. Its still incomplete as far as some tables I need to add and some vba for my tank conversions.

If you remember my old DB I guess I had been going the route of a spreadsheet with some DB functions but now that I'm trying to do it as you suggest I feel stuck at the point of this upload but also optimistic about the increased versatility I was able to add so far.

I'm thinking everything that needs to be included in my daily report will have to be pulled together in a query and calculated there but when I tried to test that I got a error about unrelated tables. I'm also confused on how I need to get the modified aggregate information to a report since it now consist of multiple rows rather than the 1 long row.

Thanks
Attached Files
File Type: zip Database_2019-03-17_(2).zip (69.7 KB, 30 views)
Mar 18 '19 #17
twinnyfo
3,653 Recognized Expert Moderator Specialist
Question 1 - Basically what I posted prior. A main table "usage" linked to a table "type equip" and also linked to a table "equip num" with relationships to keep integrity, cascade update correct?
I think you're starting to get the hang of things. This is a process, so try not to get discouraged. With your tblEquipNum, I recommend restructuring:
Expand|Select|Wrap|Line Numbers
  1. tblEquipment
  2. EquipID      AutoNumber, PK
  3. EquipNumber  Identification of Equipment (as you have it now)
  4. EquipType    FK to tblEquipTypes
Then in tblEquipUsage, all you need is EquipID.

Question 2 - Being as I have tables to store the equipment type and equipment number is there a easy way to add new from the combobox. I do have some vba code but requires the table to be open.
I'm not sure what you mean (exactly). Are you asking if there is an easy way to add a piece of equipment so that you can use it on your form?

Yes - You could manually add it, but that's no fun. If a user can't find a piece of equipment from the drop down, have an "Add Equipment" button that brings up a small form which allows the user to add a piece of equipment. Then after they are done, it refreshed your Combo Box--this is s discussion for another thread.

Question 3 - Can the appearance of the datasheet view be modified? It opens enough space for 3 times the fields I actually have so basically much wider than needed.
1) I'd have to see what you are talking about because I'm not sure I understand.

2) As a general rule, I avoid datasheet view as much as possible. There can be several good uses, but I prefer to use form view so I can control what does into my DB.

Question 4 - Once I complete all my table sets such as Equip, Aggregate and so on how do I "join" the tables or join them in a query so that my report generates everything from the same date. I know you used some vba but I didn't really understand how it worked.
1) Question for another thread, but...

2) I get the impression that on each date "something" is occuring, such as, you view each date as a "production run" perhaps? If this is the case, then the "master table", if you will, would be something like tblProduction. Then, both the Aggregate and Equipment tables would have an FK to the ProductionID. Then you only have to record the date of the production run--all aggregate/equipment used for that ProductionID would be on that same date.

So............. .... to make a long story short, this shows the importance of planning out your DB very well before you start building it. This is not your fault, as you've probably never designed a DB from the ground up before. I think all of us who have been self-taught have learned these same principles over time. However, on the road of self-instruction, the main rule to always keep in mind is, "You'll never get it right the first time." As long as you understand that any "mistakes" you are making are out of inexperience, and you continue to learn from those previous attempts, all is good.

As I mentioned before, I think you are starting to move along the right road. This is a journey--not a destination. I continue to learn every day.

Hope this hepps!
Mar 18 '19 #18
williamson1979
174 New Member
If you could open up what I uploaded last. See if I’ve made any critical errors please. Also I have PK bit no FK?
Mar 18 '19 #19
twinnyfo
3,653 Recognized Expert Moderator Specialist
I did open it up and my last response are my recommendations . I didn't explore the forms at this point, because I want to get the tables right first.
Mar 18 '19 #20

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

Similar topics

1
2531
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, just not sure: #include "stdafx.h" #include <vector> using namespace std; typedef vector<double> field;
4
1915
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 field?? Thanks Oak
0
3466
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 when you type your name it will enter it in the employee table and in the form, but I keep getting a error saying "Control can't be edited; it's bound to unknown field 'EmployeeID' " could someone help me fix this? I don't really understand what I...
0
1096
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 datarow and datacolumn would be ok.. SqlDataReader objRead = m.DataRead(conn,sql); DataTable myTable = objRead.GetSchemaTable(); while ( objRead.Read() ) {
0
1689
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 runtime it is not working. here i send the the coding.help me to correct this prob.thanks advance for ur help strqry="SELECT column_name FROM information_schema.`COLUMNS` C where table_name = '"&query1&"'"
5
14284
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. I have done this in the past in SQL server, but DB2 is not as easy... Anyone out there that can help me? Your help will be much appreciated.
0
1142
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 table using an SQL Procedure. I also would like to store the information from the file, including the file name, in another table so I can refrence the information from SQL instead of refering back to the files. If there is an easy way to do...
8
2690
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 is a picture approval page. Each picture (belonging to a group) has two radio buttons and a submit button attached to it. Since the number of photos listed for each group is unknown, the names of the yes and no radio buttons had to be uniquely...
4
5521
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, middleinitial (No prefixes or suffixes, etc.). Sometimes the field is blank and sometimes there is no middle initial. I found the following code on the Internet and it seems like it will work except I get an error message regarding Null values, and it...
7
1835
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` PROCEDURE `spLogMeIn`(IN uname varchar(12), IN upwd varchar(40)) BEGIN SELECT memberid,memstatus,mememail,avatarname FROM tblmembers WHERE memuname=uname AND mempwd=upwd; END PHP: db.php
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8894
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8803
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8587
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.