Filling In TextBoxes
Nov 10, 2005
I have a table with names of people and the cars they own. I made a form with a combobox which everytime i choose the name of the person in my combobox, it will list the cars they owned. That works fine. Problem i have is that i have to show how many cars they own. So i made a query to count the number of cars for each person. Then I made a textbox on the form to show this count. However I can't seem to link this textbox to the query since my form has a record source to the table of ppl and cars. How do i link my textbox to my query of counts of cars?
I tried changing the control source pointing to the field of the query but it doesn't work. I have linked the combobox selection so that my query filters to wat i select on the form. Anyone can help :( , its a simple process but i keep trying and doesn't work, and also dont wanna use a subform.
View Replies
ADVERTISEMENT
May 29, 2006
Hi,
I'm having some trouble with a report I am responsible for. I'm novice to Access, so if you could please explain in detail...that would be great.
Well, I am supposed to create a report, that will pickup data from 1 table (Passport_details), and display them in a report. Within the passport Details table, there are 3 fields (Scrap, Resale and RTS). For each record, their will only be a number in one of these fields. For example:
Product status: **here is where Scrap, Resale or RTS goes"
PassportID Product Scrap Resale RTS
123456 Battery 9 0 0
987654 Pots 0 7 0
456789 Knives 0 0 3
What I want is a textbox or label at the top that will state "Scrap" if there's a value other than 0 in the Scrap Field....."Resale" if there's a value other than a 0 in the Resale Field, and "RTS" if there's a value other than a 0 in the RTS field. There isnt occurences where their may be a value for two of Scrap, Resale or RTS...its either one of them.
I'm sure this is simple for the experts within this forum, but I could sure use the help.
Thanks,
Infamous
View 3 Replies
View Related
May 23, 2007
Hi all:
I have an inventory table, and I wish to pick items from that inventory table and populate an order placement table.
In oracle, clicking one of the item windows in the form provide with a LOV (List of Values), and usually items are picked from there.
How do I achieve this in Access, and it does not have to be LOV as in Oracle.
I shall be thankful for your kind help.
Regards - Prabir.
View 4 Replies
View Related
Mar 7, 2005
I need a text box in a form to display a series of error messages depending on the result of a DateDiff result, but I'm having trouble creating a single formula that encapsulates all error messages, but I have been able to get this working easily enough using 3 text boxes (For 3 seperate error messages one for results between 7 and 13 days, another for between 14 and 27 days and a third for 28+ days) and the same basic formula, I just need help combining them into a single formula for a single text box. I'm using these:
=IIf([DateDiff]>=7<14 and [Bleh] is Null, "7 Day Warning", "")
=IIf([DateDiff]>=14<27 and [Bleh] is Null, "14 Day Warning", "")
=IIf([DateDiff]>=28 and [Bleh] is Null, "28 Day Warning", "")
How would one go about combining all those formula's? I tried for ages today but I didn't come up with much, experimenting with Or IIf etc... but coming up with -1's all the time. Any help would be appreciated
View 2 Replies
View Related
Apr 26, 2005
OK, this is my first post and unfortunatly it is for some help...
I have searched Google to my wits end without any luck.
Heres my problem (partially) and I am hoping some kind person can help me.
Suppose I have a form [form1] and a query [query1].
On form1 I have a 2 textboxes. [txtProduct] and [txtStockCount].
Into [txtProduct] I enter the name of a product. In reality I have already a usable listbox in my form, but I am using a textbox for simplicity here!
Now I create an [EventProcedure] using 'On Lost Focus' against [txtProduct].
The event prodedure would partially read:
"SELECT query1.StockTotal, query1.Product FROM query1 WHERE = Product = txtProduct;"
In my actual form I am using a listbox with a listbox.rowsource = (SQL Query)to display the stock count, but I don't think this is the best way... (It works, i'll give it that!).
What I would ideally like to do is take the results from that aformentioned query and display them in txtStockCount.
What I am aiming for is to get the a query to dump its single result into a variable; not just for display purposes (txtStockCount), but to later validate user input when they wish to reduce stock values from the database, IE so they cannot produce negative stock counts.
I have a feeling this might involve Record Sets which I know nothing about at present.
If someone could either provide some working sample code snippet or point me in the right direction I would appreciate it.
I am confident enough to write SQL statements. I am semi confident in using VBA. (I am not a complete newbie).
If I have not been clear enough, I can provide a lot more information using actual details from the database I am trying to develop.
The database is a stock control system which records:
* products in one table
* transactions in another table (goods in and goods out)
* a query to 'sum' up 'goods' in and 'goods out' with an expression to create total stock counts for each item
* a form into which a user can select an item from the product table which would then produce a single count of the stock running another SQL query against the one already created to pick out that single product (phew!)
and finally in the same form add to the transaction table.
Here's hoping!
Damo.
View 6 Replies
View Related
Jun 29, 2005
I currently have a if statement checking for values greater than 0
if(x>0) Then
Statement
Else
EndIf
Is there a way for me to set the property Bold to the text box in the case that x >0?
View 4 Replies
View Related
Aug 12, 2005
I would like to use code to look at each field in my form (they are all textboxes) and if it is blank, fill it with "888". I have read enough to know I should use the NZ function, but can someone tell me how it should be written to look through every textbox on the form?
View 11 Replies
View Related
Nov 5, 2005
Hy
This is maybe a question that has been asked a million times.
Can anyone explain me how you can link to textboxes in a access form.
I'm making a form that input info. When a user selects a number in the first textbox I want that in het second text box the info of that number is showed automatically. Those two (number and info) are in the same table.
And is this possible without using visual basic for applications?
Thx
View 1 Replies
View Related
Dec 5, 2005
hi
is there anyway to temporarily store the information being entered into a form before actually writing it to a table. i want information to be added to the table only once the save button is pressed. i dont want the table to be used even as the scratch pad.
Thanks
View 3 Replies
View Related
Feb 2, 2006
Hello all,
Thanks to all the folks that have helped with my posts in the past.
I have 2 questions.
I have a form with textboxes.
When I tab from one textbox to the other, the tab goes to one of the buttons on the page. How do I tab from one textbox to another.
Also, I have a textbox for memo. I would like to press enter and go to the next line in that textbox.
Thank you very much.
View 6 Replies
View Related
May 1, 2006
hi everyone,
i have a query which returns n number of rows. my problem is that i need to display the values in text box which is created automatically according to the number of rows returned in the same page(form).
for example if my query returns 1 row then 1 text box must be automatically created and then the value must be displayed and if my query returns 3 rows then 3 text boxes must be created and then the corresponding three values must be displayed.(on the same page).
is this possible?
aravind.s
View 3 Replies
View Related
Jul 27, 2006
Hi all,
I have been trying to create a database that looks after staff holidays.
Here's how it looks at present
TBL_Holidays:
Staff_Index
Staff_Name (From a lookup)
Start_Date
Number_of_days
TBL_Holidays_Booked:
Staff_Name
Dates_Booked
Once the form (FRM_Holidays) is filled out I had (until I gave up and decided to ask for help - 2 weeks) a button that went off and run a append query.
Here's my problem. Once the button is pressed I need the TBL_Holidays_Booked to fill with the Dates_Booked.
ie.
John Smith wants his holiday to start on the 1st August for 10 days.
The resulting TBL_Holidays_Booked would look like the following:
John Smith 01/08/06
John Smith 02/08/06
John Smith 03/08/06
..
John Smith 10/08/06
Is there a way to do this? or is there a simplier way of doing it?
Regards
Mark
View 3 Replies
View Related
Feb 11, 2005
I have a form, which is used to create proposals. The form has form headers and footers, as well as a page footer.
In the Detail area of the form there are only two fields, Description and Amount, which only take up one line. I want the detail area to determine how many pages the form will be when printed. Can a new description/amount fields line be automatically inserted after I complete one? I guess the question is, can the Detail area of the form grow automatically? If so, how is it done.
Naturally, I only want the Form Header and Footer to be printed once, regardless of the amount of pages the proposal becomes. And, likewise, I want the page footer to be printed on each page. So, if the detail area only has one line completed then only one page will be printed. However, if there are 20 lines in the detail area then two pages or more will be printed.
Any help would be greatly appreciated.
MrAviator
View 1 Replies
View Related
May 30, 2005
I have a table:
Product:
Code | Name | Description | Price
I have a form with a text box. i want whatever i write in the text box to be inserted in the table Product under Code.
Its like im inserting a new product.
How can i do that? Im new to Access and VB, so bare with me.
Thanks alot
View 1 Replies
View Related
Nov 14, 2007
Hello!
What I am trying to do is fill a field with a date until a new date is encountered. Basically, I have imported some csv data which only has the date when it changes. I have created a new field and have a row with only the date in it. Is there a way to fill the rows below the date row with that date until the next date row is found and then continue on with the next date and so on. Here's what the database looks like, basically:
Date Field1 Field2 Field3
01/01/01 null null null
null DATA DATA DATA
null DATA DATA DATA
null DATA DATA DATA
null DATA DATA DATA
01/02/01 null null null
Hopefully this makes sense and someone can give me a hand with this! Thanks so much!!
View 14 Replies
View Related
Jan 31, 2008
I have a couple textboxes (Standard) format with 2 decimal places. The textbox allows me to enter say 12.65
What I wan to do is enter 12.65 in one text box and 43.56 in another textbox and then when I click on the third it multiplys the two above and places it in the third mentioned textbox.
I have that working to a certian extent...I place a number in Textbox 1 and then another in Textbox 2, then when I click on the 3rd one (After update event fires) and multiplys then giving me (see below)
Textbox 1 = 12.65
Textbox 2 = 13
Textbox 3 = 169.00
It is rounding the values....I need this carrieed out to two decimal places....
I need it to return 164.45
How do I configure the properties to give me the correct number?
Thanks for all your help it is apprecitated....
View 12 Replies
View Related
Jan 19, 2006
hey all i was wondering, can a unbound text box be a bound textbox. I have just noticed that my unbound text box doesnt not save in the field in my table, that is because it is unboune right? but i need it to save to my table, and i guees the only way to do that is to save in in the save button right? thanks
View 2 Replies
View Related
Jan 19, 2006
hey all i was wondering, can a unbound text box be a bound textbox. I have just noticed that my unbound text box doesnt not save in the field in my table, that is because it is unboune right? but i need it to save to my table, and i guees the only way to do that is to save in in the save button right? thanks
View 9 Replies
View Related
Dec 21, 2004
I have one table (tblComplete) with a listing of 30-50 company names and associated information...
"tblComplete" has fields: AutoNumber, Company, Address, City, State, Zip, Phone
On a form I created a combo box linked to AutoNumber and Company to drop down the list. Once the 'company' is selected, I would like it and the rest of the fields (address, city, state, zip, and phone) to go into the blank table (tblSelected).
Could I use a Macro to do this or should it be a query?
View 9 Replies
View Related
Feb 7, 2005
I have a Form/subform that is used to allow editing of a user selected record from a table called personnel. When the form/subform is first opened, all text boxes are blank. The user selects the desired record from a combo box that uses a dropdown list to display all records of the table. When a record is selected, the contents of that record are displayed in the subform in which the user can then edit/modify. The user then clicks on a "save button" which then saves the record.
I want to use a msgbox that will notify the user that he has just updated a record and ask if he/she would like to update another record. If the answer is NO, then close form/subform. If answer is YES, I would like to clear the combo box and the subform text boxes. then the user can them start the process over by selecting the desired record from the combo box.
When I placed the msgbox coding into the "save" button's on click property, the NO portion worked fine. However, when YES is selected, the combo box would clear but the subform texboxes still show the previous record data (does not clear).
Can anyone provide some assistance?
Here is the code for the main form:
Sub SetFilter()
Dim LSQL As String
LSQL = "select * from personnel"
LSQL = LSQL & " where last = '" & cboSelected & "'"
Form_Editpersonnel_sub.RecordSource = LSQL
End Sub
Private Sub cboSelected_AfterUpdate()
'Call subroutine to set filter based on selected last name
SetFilter
End Sub
Private Sub Form_Open(Cancel As Integer)
'Call subroutine to set filter based on selected last name
SetFilter
End Sub
Here is the code for the subform "save" button:
Private Sub SAVE_Click()
On Error GoTo Err_SAVE_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.close
If MsgBox("You have updated information on a Detachment Member. Do you wish to update another member?", vbExclamation + vbYesNo + vbDefaultButton2, "WARNING") = vbNo Then
DoCmd.OpenForm "PERSONNEL MANAGEMENT"
Else
DoCmd.close
DoCmd.OpenForm "Edit personnel"
End If
Exit_SAVE_Click:
Exit Sub
Err_SAVE_Click:
MsgBox Err.Description
Resume Exit_SAVE_Click
End Sub
View 2 Replies
View Related
Jun 10, 2005
I'm creating an Access form and there are three sections to the form of which the user should only fill out one. So, they are controlled by a radio group and the desired action is as follows:
There is a default choice (by far, the most common) and it will be selected when the form is opened. When the user selects one of the radio options, the section controlled by that radio option will become enabled and the other two sections will become disabled/locked.
So I found that each box (textbox, combobox, etc) has the property enabled and locked. So I just set this accordingly depending on what is selected. The actual result is that the boxes will be grayed out and become disabled, but will never become enabled again.
Here's some abbreviated code:
Private Sub accountRequestType_AfterUpdate()
If Me.accountRequestType.Value = 1 Then
enableSection1
disableSection2
disableSection3
ElseIf Me.accountRequestType.Value = 2 Then
disableSection1
enableSection2
disableSection3
ElseIf Me.accountRequestType.Value = 3 Then
disableSection1
disableSection2
enableSection3
End If
End Sub
So an example of a disable function (which seems to work) is as follows:
Sub disableSection1()
Me.text123.Enabled = No
Me.text123.Locked = Yes
End Sub
And for an enable function (which doesn't seem to work):
Sub enableSection1()
Me.text123.Enabled = Yes
Me.text123.Locked = No
End Sub
So I'm a bit lost here, any ideas would be great. Are there different steps I need to take in order to enable them again? Am I being clear?
Thanks in advance for any ideas.
View 2 Replies
View Related
Sep 20, 2005
Is there a way to clear all the textboxes on my form without having to go through and assign "" to each text box value?
Thanks
Angelo
View 1 Replies
View Related
Nov 11, 2005
I need to auto populate a sub form.
Main Form
ID
Top Assembly Part Number
Top Assembly Serial Number
Sub Form (continuous form)
ID
Part Number
Part Name
Part Serial Number
Main Form and Sub Form linked by ID
(There is a separate table that has sub form part numbers for each main form part number)
Based upon the part number in Main Form I need to automatically populate the sub form with Part Number and Part Name.
Some Main Form Part Numbers have 85 sub form part numbers others as few as 3 sub form part numbers
Main Form
______________________________________
|
| ID [123 ] |
| |
| Part Number: |9999999 |
| Serial Number: |ABC-9999 |
Sub Form
_____________________________________
|
| ID [123 ]
||Part Number | Part Name | Serial Number |
|| 1111 | Widget 1 | A11111 |
|| 2222 | Widget 2 | B1234 |
|_____________________________________
View 1 Replies
View Related
May 27, 2006
Hi:
I have a form with data entry textboxes on it linked to a table and a subform
Linked to a query that sorts the data ascending so the newest entered data is the top row of the subform. Also the newest data is still showing in the textboxes which is what I want.
This is all fine and good until you exit the form and re load it.
When you reload it the subform still shows the last data entered at the top
But the textboxes no longer show the newest data entered but are showing data from several rows down.
How can I make the textboxes show the data at the top when the form is reloaded?
Thanks
Charles
View 7 Replies
View Related
Feb 16, 2005
Does anyone have a quick sample code on how to load a combo box using ADO? Currently I set the row source type to Table/Query and the row source to a query within the program. I would like to fill my combo box using code instead.
View 5 Replies
View Related
Feb 18, 2005
Is it possible to write an event procedure attached to a command button in a Microsoft Access database that would use data from an established query to pre-fill data in to a form on a web site? Has anyone tried this?
View 3 Replies
View Related