Subform Shows A Number, Not Text...
Dec 8, 2006
It's my understanding of general database practice that an Autonumber field should be used as a primary key in normalisation tables. I realise my understanding could be wrong, and I'm quite happy to change that practice if need be.
I have my normalisation tables. For the most part these consist of an Autonumber field ([UID]) as the primary key, then an indexed, no duplicates text field with the normalisation data. For this case, we'll say it's a list of departments ([DepartmentID]).
I have a form for entering users. Again, the PK is an autonumber field. I used a wizard to create a combo box. I selected the fact that I want to store the value in [DepartmentID], NOT [UID].
This works fine, I can add my users and the combo boxes work, although I had to change the bound column to 2, as 1 is selected by default although it is [UID].
I then created a subform based on a query of all users. This subform is not bound to the main form in any way, it simply shows the result of the query.
When entering users, upon saving a record, the form is updated and the new user shown in the subform. Great, apart from "txtDepartment" in the subform showing [UID], and not [DepartmentID] as stipulated.
I have a horrible feeling this is to do with [UID] being my PK, but I'd like someone to tell me I'm wrong. I can quite happily remove the autonumber field [UID] and make the unique [DepartmentID] field the PK, but this just doesn't seem "correct" to me.
Should I do this? Should I have an autonumber field as the PK?
I realise this is more a design theory question than a form problem as such, but anything that clarifies my understanding of correct design practice will help.
EDIT:- I'd also like to say that I did it this way to get away from using the "LOOKUP" field type at table design time, specifically to avoid this very problem of numbers showing up when I want the text there!
View Replies
ADVERTISEMENT
Sep 3, 2015
I have a KidShop table that shows the Diagnosis for the person,there are 5 diagnosis fields because one person could have up to 5 Diagnosis and each field is a lookup from the diagnosis table.in the report they show up as the ID number not and not the text.
I inserted Diagnosis from the Diagnosis Table and a window popped up asking what Diagnosis from the Diagnosis table matched in the KidShop Table and gave the selection of Diagnosis 1 or 3 or 3 or 4 or 5. I could only select one and I selected Diagnosis1 in the KidShop table and that showed Diagnosis as text for the Diagnosis1 field but the other 4 diagnosis fields still show a number. I understand what that did but it does not give me the option to match Diagnosis 2,3,4,5 to diagnosis Table. If I changed the Data source for the other 4 to Diagnosis then only Diagnosis1 shows up it the other 4 fields which makes since.
View 2 Replies
View Related
Oct 1, 2014
I have a form with a search box, Its UNBOUND called ID . Everytime I search for an ID number it shows no results, However I know there are entries in the table. This is the code I am using :
Code:
Private Sub ID_AfterUpdate()
If (ID & vbNullString) = vbNullString Then Exit Sub
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[Id] LIKE ' " & ID & " ' "
[Code] ....
I am assuming I need to add something to search for auto numbers but i don't know what!
View 2 Replies
View Related
Jan 18, 2006
I have 2 cascading combo boxes which control what appears in my subform (AuditYear,Company).
Once I select both, sometimes the subform info shows up and a while later I try again, and it doesn't. Then I try some other AuditYear + Company, then THAT shows up...then I try again, it doesn't.
Any ideas?
View 2 Replies
View Related
Jun 14, 2005
I have a textbox on a Subform which is updated when a record is double clicked in another Subform. This works fine until i move the mouse over the updated subform. Then the updated entry is replaced with #Deleted. The data is still in the table that gives the subform its value.
Also another form running has the same subform and it and the updated value is shown perfectly in this one.
Anyone know why this may be happening?
View 2 Replies
View Related
Nov 7, 2013
I am opening an excel file from access and changing the formatting from "dd/mm/yyyy hh:mm" to number with 15 decimal places.Then I am linking the file to the database and subsequently doing a lookup on the date time on the access form against this table.The excel file when formatted from vba in access shows the wrong number
datetime = 03/05/2013 11:26
database number = 41397.4763888889
Excel file number = 41398.4763888889 (which would equal 04/05/13 11:26)
now if I do it manually then I get 41397.4763888889 or if the macro is in excel I still get 41397.4763888889.Also I have tested the code with manually editing the excel file and this works fine.
Code:
Private Sub Command288_Click()
Dim s As String
Dim t As Integer
Dim ws As Worksheet
s = LaunchCD(Me)
MsgBox (s)
[code]....
also this brings up a form and then I select the field required for the lookup and with the button is pressed the rest of the code runs as follows.
Code:
Private Sub LoadData_Click()
Dim w As String
w = Forms![frmList1]![Combo0]
w = "[" & w & "]"
Dim dtA As String
[code]....
View 7 Replies
View Related
Nov 30, 2013
It's been a while since I last used Access but now I need to be reminded how to populate a sub-form with all rows for a query (Access 2013).
- Do I need to establish a relationship between Table A (main form) and Table B (sub-form)?
- What sub-form properties need to be set to display all retrieived rows from the main form query (select where Table A PK = Table B PK)?
View 1 Replies
View Related
Aug 22, 2012
Is it possible to have a combo box that shows date and text? I would like to have a combo box with dates that also allows the user to choose the word "unassigned." the reason for this is because sometimes we don't know dates due until a future time and that is specifically what my boss wants. They don't want the field empty either.
View 2 Replies
View Related
Jul 14, 2013
So, let's say I have a table named FLOWER_SHIPPING that has field:
Date [Date]
Flower_name [Short Text]
Amount [Long Integer]
Sender [Short Text]
Address [Long Text]
Then I created a form named MAINF with FLOWER_SHIPPING as its RecordSource. The form only has one TextBox: Date.
Then in MAINF, I created a subform named SUBF with FLOWER_SHIPPING as its RecordSource, in Datasheet View. It shows all fields in FLoWER_SHIPPING as it is.
The link between MAINF and SUBF is Date.
I want SUBF to only show record based on the Date chosen in Date TextBox in MAINF. So far, yes it did what I want. But with problems:
1) [SOLVED] SUBF does show record based on the Date I've chosen in MAINF's TextBox Date, but it ALWAYS ALSO shows the first record on the FLOWER_SHIPPING table. And the date in the first record always changed into the Date I just input in the TextBox Date in the MAINF. Automatically.
Example: I chose 6/22/2013, and there are 2 records with that date. the SUBF will show 3 records: those 2 records + the first row of FLOWER_SHIPPING with its Date automatically set to 6/22/2013.
2) When I chose a date in MAINF, I have to click everywhere in the SUBF so that it will refresh its content. Can I have it refresh automatically everytime after a date chosen?
View 9 Replies
View Related
Mar 13, 2006
Hi There,
I have got this form, consisting of 1 form (that needs to add a new record to a table everytime) and 1 subform, that needs to show the last three records of the table.
My problem is that I cannot get it right, now both forms (form and subform) are showing the details on just one record. If I open my subform it shows me all the records of a table, but in as soon as I view the form as a subform I shows me only one record.
Any help is welcome, I attached my db, just in case....
View 6 Replies
View Related
Mar 9, 2014
I have two subforms in a main form. book_sub and book order subform. there are various subforms which i toggle in book order subform window by changing their properties with command button on main form. here is the code -
Code:
private sub billq_click()
Me.BOOK_SUB.SourceObject = "BILLQ"
Me.BOOK_SUB.LinkMasterFields = "[BOOK ORDER SUBFORM].FORM![ORDER ID]"
Me.BOOK_SUB.LinkChildFields = "[order ID]"
private sub stock_click()
Me.BOOK_SUB.SourceObject = "stock"
Me.BOOK_SUB.LinkMasterFields = "[BOOK ORDER SUBFORM].FORM![BOOKCD]"
Me.BOOK_SUB.LinkChildFields = "[BOOKCODE]"
Now the problem is when i change billq to stock it shows parameter entry window with caption [order id] twice. after clicking ok it does toggle the form to stock. then when i click button for billq again it shows the same thing.
the code works fine except showing parameter entry window twice with every toggle.
View 2 Replies
View Related
Jun 18, 2015
I want to find a way to grab the text from the window that shows the location of the file using vba in Access.
View 3 Replies
View Related
Mar 2, 2015
I am a bit of a novice when it comes to Access, but have managed to create a form with a subform embedded and various filters to show different data within the subform, including a date range filter. The code I have used for these filters is as follows:
Private Sub Command40_Click()
Dim strCriteria As String
strCriteria = createCriteria("[Introductions].Town", "List78")
strCriteria = strCriteria & " and " & createCriteria("[Introductions].Ownership", "List52")
strCriteria = strCriteria & " and " & createCriteria("[Introductions].Company", "List54")
[Code] ....
This all works fine, but I'm wondering what I need to add to this code to make it so that if the date boxes are left blank, records from all dates are displayed. At the moment I have to enter dates in order for it to work properly.
View 5 Replies
View Related
Sep 1, 2013
In my database main form with subform. subform have query as recordsource.total of one of field in subform shown on main form. all is ok and show total correctly but when subform have no records then total field on main form shows #error. How to convert this value either into null string or zero(0).
View 2 Replies
View Related
Sep 22, 2014
I have several subform tabs and one that I have updated no longer shows up when I run the form on Form mode. The tab is there but no content or details of the subform
View 3 Replies
View Related
Nov 26, 2004
Date of Birth (DOB) field etc. in one program are text - how do I make another file with the same data into number fields for Date of Birth field etc? When I copy data to file that has number fields the 09252004 is changed to 9252004. Can I get reports with the correct Date of Birth in them by moving data from text file to number file?
There is data entered monthly in file and formula has been set up for January, February etc as ---quarter: Int(([month]-1)/3)+1. I would like formula for the fiscal year for April to be counted as month 1, May - month 2, June as month 3, July as month 4, August as month 5, Sept as month 6, October as month 7, Nov as month 8, Dec as month 9, Jan as month 10, Feb as month 11 and March as month 12.
Thank you
View 6 Replies
View Related
Feb 14, 2014
I want 2 text , when I add a name to text 1 automatically set number to text 2 (Random),
View 3 Replies
View Related
Jan 6, 2014
My database has Main form and a Sub form. On main form i place one unbound text box named investigations. In subform of which datasheet there is a column named TestCode. I want unbound text box (Investigations) to display row values which selected in a column (TestCode) of subform.for example:Investigation field should display "CBC,HB,ALP".
View 5 Replies
View Related
Sep 5, 2013
I have a form that is displaying a subform (of which source is a query). I have got the data from one of the columns in the subform going into a text box (entered in the control source) however when the field is empty it comes with a #Error in the textbox.I want the textbox is display some text is the subform value is null.
View 11 Replies
View Related
Jan 10, 2007
Hi all.
I have text field with mask:
XXXXX-X
(x are digits), for example - 4 01-1, 4 01-2...
I need find field with text beginning 4 01 and max of last symbol. Last symbol +1, then again convert to text field. For example:
for example 4 01-1, 4 01-2,4 01-3 - must find 4 01-3 , then 3+1=4 and 4 01-4 format again to text.
Please, help me with formatting.
Thank You in advance.
View 5 Replies
View Related
Sep 14, 2005
Haven't been able to find an answer to this one. I have a subform that is related to the main form by order number. In the subform, user will enter qty received for a po. Because we may not receive entire quantity for po at once, we need to add a number or letter to the end of the order number to indicate more than one received qty. So order number 1234 would be 1234-1 for first quantity, then 1234-2 for second qty. Does anyone have any ideas on how to accomplish this? Thanks for any help. I am using Access 2000.
View 3 Replies
View Related
Jun 6, 2007
Hey,
I have a small question. There is a table that I am trying to use that houses product numbers, the only problem is that those product numbers start with a '0' but the '0' got deleted because the numbers are housed in a number defined field. If I change the table properties to text, is there a way I can add a leading '0' infront of every existing product number?
Thanks,
Viperstingray
View 2 Replies
View Related
Sep 19, 2007
again maybe a simple question...
How to convert a numeric field to a textfield.
In Crystal reports quite easy (totext([fieldname]), but don't know how to write in (good) SQL
thanks in advance
View 2 Replies
View Related
May 15, 2013
I needed to change the decimal symbol from a dot to comma for use in Europe. On changing the the settings to a comma everything works fine but for the field that I have the code in the AfterUpdate properties
Private Sub SprayCfuelC_AfterUpdate()
Me.Dirty = False
CurrentDb.Execute ("UPDATE ProcessData SET ProcessData.SprayCFuelC =" & Me.SprayCfuelC & " WHERE (((ProcessData.AuditNo)=" & Parent.[AuditNo] & "));")
Me.Recalc
End Sub
Now when the data is changed I get a run time error 3144 - syntax error in UPDATE statement.
View 5 Replies
View Related
Jul 14, 2005
I'd like to take a branch number field, let's assume it is "223" and change it to "223 No Com". Is there a way to add the "No Com" on the end of it like that?
View 5 Replies
View Related
Aug 2, 2005
I have a table with the following fields:
Tool Text
Tool_ID Text
Description Text
The Tool_ID field holds a number if the tool provides a tool id. However, if the tool doesn't provide a tool id, the text "No tool ID given" is automatically placed into the field. Therefore, it needs to remain a text field for this reason and others that are too long to go into.
Anyway, I created a query that pulls only one specific tool which always provides a tool ID. Therefore, the results of my query will always have a number in the text field "Tool_ID".
Question: Is there a way to convert the text field to a number field within the query?
Thanks in advance!
~ Greg
View 4 Replies
View Related