Unbound Controls To Insert Record
Jun 12, 2006
Hi guys. I hope someone replies to this thread....I am struggling with this one.
I am developing an Asset Management System for our IT Equipment.
We wish to record the software installed on each PC.
The Manufacturer and Software names are stored in separate tables.
The AssetMain table has a one-to-many relationship with the AssetSoftware table.
I originally had a (continuous) subform for software on my main Asset form. However, as I am using cascading combo boxes (to filter the Software Combo by the Manufacturer) it mean that changing the combo on each record would appear to change the existing values too (common problem).
I would therefore like four unbound controls.
1) Combo Box - Manufacturer
2) Combo Box - Software Package
3) Combo Box - Package Edition
3) Text Box - Serial Number
When the user selects/enters these values and clicks an "Add" button I would like add a new record into the AssetSoftware table where Asset_ID = Parent.Asset_ID.
I will then have a list box that queries the software for that particular Asset. This will requery on each CmdAdd_Click.
Attached is a screenshot of what I would like to achieve (if I click Add it should add Microsoft Office XP to the list box below)
Would really appreciate some help (do not normally get many replies to my threads :( )
Thanks
BF
View Replies
ADVERTISEMENT
Nov 8, 2005
I'm having a bit of a problem - I built quite a complex db that works great and I'm comfortable with code and access. But, I've been working with ASP for a while now and I think it has made me a bit fogetful re: Access.
If someone can point me in the right direction conceptually it would be appreciated. My system is primarily built around scheduling and I have created tables and web forms to interact with my current access database to allow our recources to check and confirm their daily schedules online.
My problem is on the Access side. I need to build a dashboard using a form that queries the table that holds our resources status information and will display whether or not they've logged in and confirmed their schedule. As well, I need controls on this form to allow me to update their individual schedules if it has been changed. Most of this is no problem, the big problem I'm having is the display of information and form interaction... Can I use a continuous form for this?
When I try to use unbound controls such as images - hiding/unhiding images depending on a specific records value (for let's say a traffic light that shows whether a resource has confirmed their schedule) - it seems that I can't control images, checkboxes, etc. for individual records on the continous form with code as all these unbound controls defualt to the value of the first record.
View 3 Replies
View Related
May 31, 2015
I have an unbound form with 2 tabbed Controls on it.On the first Tabbed Control my command button code works but not for the 2nd tabbed control. Although the command buttons themselves work as far as going to the appropriate record.
What I mean by this is that I use code to enable/disable the command buttons depending on what record you are on.
Example: If there is only 2 record, the other command buttons will be disabled, Do I have to refer to the Tab Control ?
View 1 Replies
View Related
May 16, 2013
What really is the best way, programming-wise and user experience-wise when presenting records in a form:
1) Use the form with sub-forms to show records. Add new records via a popup form and use recordsets in VBA to allow validating.
2) Use unbound controls on a form and populate with pure VBA recordsets. For data with more than one row use list boxes. A popup form used for adding new or editing etc using VBA.
3) Another I haven't thought of; new or a combination of above?
View 2 Replies
View Related
Jun 2, 2014
I have placed an unbound subform on a form. I have the following code which loads in different datasheet to the subform:
'Loads in NewQuery
Me.data.SourceObject = "query.NewQuery"
'Loads in NewQuery2
Me.data.SourceObject = "query.NewQuery2"
etc.... this works fine to show these queries but i want to know how to reference the fields on the datasheet.
for example one of the fields in NewQuery is "ID"... When clicked i want to run code... normally on bound subform i could go for example ID_Click()... msgbox(me.ID)
how can i reference these other fields on unbound???
View 3 Replies
View Related
Aug 13, 2015
There are 4 unbound dropdown list box that will have a default value of empty string. All 4 must have values entered (data is required).Once all 4 are required - the bottom 5 text box will become enabled (optional data).Forcing the user to click on a Validation Button
Some users type then use the mouse to select the next.Other users type to select then tab.The trick is: After filling in the 4th listbox and validating all 4 have values, the event must trigger code to enable the 5 optional text boxes below.This provides a seamless data entry environment.
I have been doing this in other places, but the transisition after the last required field is complete gets ugly.If Trim(cmbBoxname1 & "") = vbNullString ' check all 4..If it is the 4th one, the event seems not to happen quick enough for the bottom 5 text boxes to be enabled so the user can continue with data entry.
View 9 Replies
View Related
Mar 11, 2015
I am working on a timesheet application which allows users to insert multiple timesheet entries in a grid style format. the first row is visible and to add another row users click on a command button which makes the next row of fields available and ready to fill in and so on and so forth. I need the fields to be unbound and then when the user clicks on a save button for example then it inserts those values into the relevant table. Table name is tbltimesheet, field names are id, companyname, project, activitydate, activityhours, activitynotes, username, userid
View 2 Replies
View Related
Aug 17, 2005
I can't get my "undo" code to work on my form that uses unbound controls.
Is this not possible with unbound controls? Is there another way?
Here is the code I have tried:
DoCmd.RunCommand acCmdUndo
I also tried:
e.Undo
Also, the "Undo" command is not available in the menu.
Any workarounds for this?
Thanks,
BJS :confused:
View 3 Replies
View Related
Jan 28, 2005
I have a continuous form based on a query. I would like to have a button or control that performs some command on only one certain record. In other words, the user sees the record he wants, clicks a button and it changes the value or changes the color. When I add a button to the form, it appears next to each record and performs the same command to each record. I have tried different controls, but get similar results with each one. Even a single form seems to do the same thing, but on different pages.
Am I missing something? Or maybe I am not following the concept of the form.
View 13 Replies
View Related
Aug 8, 2007
Hello,
I have two controls on my form that I want to reference in an append query to create a new record. The first is a text box, the second is a combobox that is populated with all of the dates associated with the text box. The selection of a date updates a subform based off of a hidden column (chart ID, an autonumber field based on combinations of record numbers and visit dates) in the same combobox.
I would like the user to be able to enter a new date and create a new record that would contain the next autonumber in association with the new date and the record number from the text box control. I have tried using an append query with the following SQL, but I consistently get errors referring to "type mismatch." Any help would be greatly appreciated; thanks in advance.
Code:Private Sub cboDOVSearchChart_NotInList(NewData As String, Response AsInteger)Dim ans As Variantans = MsgBox("The date you entered was not found. Do you want to add a newdate?", _vbYesNo, "Add New Date?")If ans = vbNo ThenResponse = acDataErrContinueMe.cboDOVSearchChart = NullDoCmd.GoToControl "cboDOVSearchChart"GoTo exit_itEnd If' add dateIf ans = vbYes Then Dim strSQL As String strSQL = "INSERT INTO Patient_Visits ([Medical Record Number], " _ & "[Date of Visit]) " _ & "Values (" & Me.[txtChartMR] & ", " _ & "#" & CDate(NewData) & "#)" 'this line has the arrow on debug CurrentDb.Execute strSQL Me.cboDOVSearchChart.Requery Me.cboDOVSearchChart = NewData Call cboDOVSearchChart_AfterUpdateEnd Ifexit_it:End Sub
View 2 Replies
View Related
Jan 22, 2014
I have two unbound unlinked subforms residing on a 3rd unbound main form. When I enter the current record on Subform1 I would like the matching record(s) on Subform2 to be highlighted or otherwise formatted. I can get this to work for only the first record on subform2 due to the way I have my code setup on Subform1:
Code:
Private Sub Accounting_Unit_Enter()
'find where AUs match. only works for first Subform2 record
If Me.[Accounting Unit] = Forms!MainForm.[Subform2]!AccountingUnit Then
msgbox "Match"
End If
End Sub
My thought was that I needed to reference the Recordset of Subform2 and search for all AccountingUnits that match the current AccountingUnit of Subform1,
View 6 Replies
View Related
Apr 5, 2005
First, just want to say I wish I had found this site a long time ago. Lots of good stuff here :) I don't know a lot about Access, but know it can be a great tool for what I need. So I hope I can find the help I am looking for...
Ok, on my form I have three unbound combobox's that I use to filter the information I want. The first two do not need to be used, meaning that the third combobox will show all the records if the first two are left blank.
With that being said...
I would like the form to show no data until the selection is made in this third combobox. SO, my first question is how do I make the form show no records till this combobox has a selection. And second (at the same time), make that third unbound combobox with the selection load that record to the form fields so they can be viewed or edited??
I'm sure it can be done, but I am lost...
Hope I explained it ok :)
Thanks in advance!!!!!!
View 1 Replies
View Related
Dec 2, 2013
I have a form with subforms, where the main form's source is a table called tblCharts. Within this table there is a field called ID that is autonumbered.
So I created a combo box that's row source is a query that selects the ID field from table charts and two other descriptive fields to make navigation easier. Limit List is set to yes.
The problem comes up with code that I've used multiple times, but not with an autonumber. The code typicallly looks like this when I'm searching on a text field.
Code:
Sub cboPatientSelection_AfterUpdate ()
Dim rs As DAO.Recordset
If Not IsNull(Me.cboPatientSelection) Then
If Me.Dirty Then
Me.Dirty = False
[Code] ....
This worked at first but then 3070 runtime error came up, the form started messing up. So I made this code
Code:
Sub cboPatientSelection_AfterUpdate ()
Dim rs As DAO.Recordset
If Not IsNull(Me.cboPatientSelection) Then
If Me.Dirty Then
Me.Dirty = False
[code].....
This code worked at first, so I decided to make a copy of my form called Copy Of frmCharts. After this the code stopped working on the initial frmCharts but now works on the copy.
I also received other errors besides 2070. I know what error 3070 is but I can't figure out why it's not working on this form. I closed and opened the form a few times and it happened to start working. Very frustrating when I'm trying to make the system reliable for others to use
The code only seems to do this when I enter design view then switch back to form view.
View 11 Replies
View Related
Nov 11, 2011
I am using an Access form that I created on an earlier version of Access and I have been able to insert (add) new records with this form and database.
Recently, I added some text, moved some text around on the form, and saved the form.
Sense my revisions, I am unable to insert (add) new records. (The "New" button in the software's header is grayed out.)
I have saved and compacted/repaired the form/database, but this did not solve my problem.
View 4 Replies
View Related
Dec 3, 2005
Hi,
As a part of reducing traffic on file server, I am planning to read less record on the form and hence I tried removing forms record source. (Attached sample db)
I kept all unbound textboxes onto the forms and save new record to the table using codes back of the command button. This is working great with main form. But doesn’t with sub form. I tried removing record source of sub form and keeping unbound text boxes to appear record if it exists.
If you enter 1 in InvNum text box on main form, you will find it brings record. I don’t want to show the record on the sub form unless I call it from main form.
How can I use the same trick of unbound text boxes with sub form too?
Please extend your help.
With kind regards,
Ashfaque
View 8 Replies
View Related
Jan 23, 2006
Hey, I am trying to figure out how to update an unbound textbox on a form to reflect conditional data in other boxes when each record is viewed (pages works with reports but I cant find something similar with forms). such as if I had an unbound textbox that I want to = firstname+" "+lastname I would want for it to update it every time a user goes to the next record.. I can't seem to figure out a command or method that executes every time someone goes to the next record.. (and Im not too familiar with all the commands that come without a GUI).. thanks for your time
View 4 Replies
View Related
Feb 20, 2006
Hi All,
I hope someone can help me.
I have a table here tblTemp with a field client. This table can have from 1 to 100 records at times as it keeps getting cleared for the purpose of this exercise.
I also have a form frmLabel1Data with an unbound text box txtclient.
I was hoping to get the first record of the table into this text box upon opening the form.
I tried creating a query which gave me the following sql;
SELECT First(tblTemp.client) AS FirstOfclient FROM tblTemp;
I also tried placing it in this code with no luck
Private Sub Form_Open(Cancel As Integer)
Dim SQL
SQL = "SELECT First(tblTemp.client) AS FirstOfclient FROM tblTemp;"
MsgBox SQL
End Sub
Does anyone know why I cannot see the same result as when I open the query it gives me my client name but the code above does not????
Any help is appreciated.
Robert88
View 2 Replies
View Related
Nov 18, 2013
Working with Access 2000
I have a Continuous subform based on a query based on few linked tables.One of those tables has a Yes/No field which shows in the subform.
I want to be able to change the status of this field for each record independently, so I placed an unbound check box in the subform Detail section and a Command button on the subform Header section. However when I click one record check box, all of them change, I did not expect that. How do I move forward to get this done?
View 10 Replies
View Related
Nov 4, 2004
May I insert a record into the top of a table?
Please help me! Thanks very much!
My email: jokelogpop@yahoo.ca
View 9 Replies
View Related
Jul 20, 2005
Hello
I have created a table of Some machines specifications.
Item Name Type location
1. Sieve156 Sieve 3rd floor
2. Rollermill1 Mill 1st floor
....
...
...
When inserting for example a new sieve machine I want database
add automatically this machine between items 1. and 2. and assign the item
number 3 to rollermill1. but this new record is added to the last row and its
item number will be 3 but it should be 2.
What shall I do for this problem? (in excel it is easily possible to add a row
between two rows.. is it also possible in access?)
thank you
View 6 Replies
View Related
Sep 27, 2007
Hiya,
I've inherited an Access 2003 database, a rather complex one. The database has a login, with the credentials stored in a table which I can view (minus the pass, which is masked). Of course, for security reasons, I shouldn't be able to just add a record and create a new ID, in essence bypassing all security. As such, the table with the user records does not permit new records to be added. What steps need I take to add new records, the option being greyed out in the interface, no new record bar available at the bottom of the table.
Any insight is most appreciated.
Slawek
View 1 Replies
View Related
Aug 15, 2014
In my VBA code, i am trying to move some table records from table1 to table2. Both table1 and table2 has exact structures.
In the INSERT statement for table2, what is the easy way to insert a record from table1? I am trying to avoid having to specify each field name in the INSERT statement. Because, i have 100 fields in table.
Is there a way to INSERT a particular record from table1 to table2 without having to specify field names in the INSERT statement like in below example?
INSERT INTO Employees " _
& "(FirstName,LastName, Title) VALUES " _
& "('Harry', 'Washington', 'Trainee');"
View 1 Replies
View Related
Feb 20, 2006
Hi,
I want to show some text from another table based on the values of the bound fields in each record of a continuous form. I thought it would be easy, but I can't get it to work.
I step through the records in the bound recordset and use some of the values to query another table. Then I use the value from the query to populate the unbound text field.
It works fine for each record. But every time the unbound field is updated, all the records in the continuous form are updated.
I'm stuck on this one. It's probably something simple to fix - if you know what to do!
Do you have any suggestions?
Thanks!
-Daniel
View 10 Replies
View Related
Jul 3, 2013
Using DAO recordset, table enters unbound fields data properly for desired records, but adds an extra record which is a duplicate of the first record entered....any known access quirks for adding unwanted records?
View 3 Replies
View Related
May 2, 2007
Using the sql profiler gives me no clue.
This is the insert query from the profiler.
exec sp_executesql N'INSERT INTO "ENVIS_GSD".."wat_springflow" ("result_dt","site_id","result_va","remark_tx") VALUES (@P1,@P2,@P3,@P4,@P5,@P6)', N'@P1 datetime,@P2 int,@P3 float,@P4 nvarchar(4),@P5 varchar(3),@P6 datetime', 'Feb 10 2009 12:00:00:000AM', 3000723, 8.000000000000000e-001, N'test'
The two records that I get the proplem on are not included here, but somehow they have been updated. I traced the access code, but I could see no reference to them that they were used for the update in either the form or any modules called.
Somehow up to a few weeks ago those two columns were updated.
Tracing the code and using the immediate window the user_name variable stores the login name corectly.
Someone mentioned "error 28" any ideas?
Thanks in advance
View 1 Replies
View Related
Apr 13, 2005
Hi folks,
I have an Append Query (Insert Into...) that I use to insert values into a table from a form. But to have that tie into other tables I need to gather the Student_ID (primary key) that is autogenerated when the record is inserted. How do I do this? I want to store it in a public variable. I've done quite a bit of searching but nothing of any value has turned up. Please help.
What I have on button press:
DoCmd.OpenQuery "Register Camp Students"
After that I need something to gather that newly inserted Student_ID and store it for later use. Please help!
Ciao,
jawilli1 :confused:
View 4 Replies
View Related