Modules & VBA :: Subform - Up Down Arrows Through Records
Jun 16, 2014
I have a form which has a subform that holds records from a table. When in the table i can move through the records with my up and down arrows but when I am in the subform i can not move in the same manner with up and down arrows. What needs to be done on subform to allow user to move through records using up and down arrows.
View Replies
ADVERTISEMENT
Dec 8, 2014
I had set Data Entry to True in order to always default to a blank record. However that locked up my ability to use the arrows to navigate between records in the database. Is there a work around?
View 9 Replies
View Related
Mar 5, 2015
I have a form with a subform. I would like a control in my parent form to uncheck a checkbox control in my subform when that field value is deleted . I can get that to work if there is only one record in my subform but it doesn't uncheck the rest. how to I reference all the records in my subform so all of them will uncheck when I delete that field value?
View 2 Replies
View Related
Nov 16, 2013
I have created three forms using three tables tblUser, tlbMeasure and tblSubMeasure. The tblUser is linked to the tblMeasure table via UserLogin and tblMeasure is linked to tblSubMeasure via MeasureID. The forms are created with frmMainMeasure being the main form and frmMeasure6 a subform and frmSubMeasure a sub with frmMeasure6.
I want to be able to add sub measures that will be linked to each MeasureID and each MeasureID link to each user via UserloginID. The forms load the data in the sub forms but when I try to add sub measures using a button I added on the frmMeasures6. The button works when I try work on the form fine but when I try via the main form I am not able to add or view other records within the table.
When I click the Add button I want to be able to load back the same MeasureID number in fmrSubMeasure to ensure that it is linked to the same measure and the MeasureID is linked to the same UsrrLoginID.
The code is included below and I've attached the file as well.
Private Sub cmdAdd_Click()
If Me!frmSubMeasure.Form.Dirty = False Then
End If
Me!frmSubMeasure.SetFocus
DoCmd.GoToRecord , , acNewRec
[Code] ....
View 1 Replies
View Related
Sep 9, 2013
I have button the when pressed will insert a record (via an insert into query) to the frmMain and several records to the frmSub.The problem is when a new record is created in the main form the auto number primary key advances. This is fine however the linked Child field which is a foreign key of the main form is not added and the value is blank. I thought this would happen automatically and the Master field would force the child field to be update but this is not happening.Do I have to determine the max number used in the auto number then add 1 to it?
View 7 Replies
View Related
Feb 23, 2015
I am trying to add a save/close button to a form that will only close if certain conditions are met and if they arnt then display a message box.I got the basics on how to save and close the form, do a simple if statement and display the message I want but the problem im running into is my subform can have multiple records and of those records each records status is set by 3 different checkboxes. I need all of those records status to be same when the form is closed.
if I do an if statement like
If Me!frmDataform1subform.Form!StatusID.Value = 1 then
docmd....
then all it looks at is the first record, how do I get my if statement to look at all the records in the subform?
View 2 Replies
View Related
Sep 12, 2013
i want to Count recrods by a pressing a button from a subform.
After counting the records from the subform, it should compare the amount of the records with a number.
The user can put in the number.
The field for the number is called number.
The button is in the form.
I've created the following code.
The Name of the subform ist Abfrage_Vergutungssatze_Unterformular
Code:
If DCount("*", Me.Abfrage_Vergutungssazte_Unterformular) > Me.number + 1 Then
MsgBox "Please recheck!"
I've get an error.
error message: errors when compiling
View 4 Replies
View Related
May 26, 2015
I am working with a database that deals with trailers. What is happening is a salesman takes an order for a make and model for a trailer for a customer. The customer can then add some customization to the trailer such as more tail lights or tie down straps. They add the customization on a form called frmCustomQuote. On frmCustomQuote there is a subform called sfQuoteConfigs. On sfQuoteConfigs there is fields such as category and sub catergory that get populated bases on what was selected.
On frmCustomQuote there is a button called "Copy Quote" this will allow the salesman to make an exact copy of the trailer and customization. The quotes are held in a table called tblQuotes and the customization is held in tbQuoteConfigs. Now my problem is when I click on Copy Quote it only copies the first record into tbQuoteConfigs. I can't figure out a way to tell my code to move to the next record within sfQuoteConfigs.
My code:
Code:
Option Compare Database
Option Explicit
'Setup ADODB connection to the tblQuotes
Dim adoQuotesCustomQuote As New ADODB.Recordset
'setup ADODB connection to the tbQuoteConfigs
Dim adoQuoteConfigsCustom As New ADODB.Recordset
'Dim the Variables
[code]....
View 4 Replies
View Related
Aug 13, 2014
I have a form that contains a subform. I want to make a button that on click updates all the records listed in the subform. This is the best I came up with.
Dim rs As DAO.Recordset
Set rs = Me.SubList_for_Billing_Center_Form.Form.RecordsetC lone
With rs
.MoveFirst
Do While Not .EOF
.Edit
UPDATE Billing SET Billing.Billing_Declined = True, Billing.Billing_Declined_Date = Date()
[Code] ....
View 1 Replies
View Related
Jun 3, 2014
I have got a received form that has 2 subforms.
The main form is based on Received Table
The 1st subform is based on a query that shows the order detail and how many units are outstanding.
The 2nd subform is based on a receivedDetail table. so will have a list of items with the original order qty, and the qty still outstanding.
When the main form loads i want it to create new records into the 2nd subform based on the 1st Subform.
so the 1st and 2nd subform run parallel with each other and appear to be as one to the user.
both subforms are continuous style.
Code:
Private Sub Form_Load()
With Me.Form.RecordsetClone
Do While Not .EOF
.AddNew
!UserFK = Forms!frmReceive!cbxUsername
[Code] ....
View 3 Replies
View Related
May 23, 2014
Im v new to VBA and been having trouble getting the following code to loop through the records in my subform:
Private Sub cmdComplete_Call_Click()
Dim rs As dao.Recordset
Set rs = Me.fsub_Call_Off_Quantities.Form.RecordsetClone
rs.MoveFirst
[code]....
It only seems to update the first records txtQuantity_Called_Off value. I have tried all the 'looping' code variations i can find and they all seem to only update the first .
View 6 Replies
View Related
Nov 20, 2013
I am working with a sub-form where once a staff member enters there sub measure I would want to create a duplicate of that record. The problem I am having is that once you enter the sub-form and click the duplicate button it creates a duplicate of the record selected but overwrites the first record in the table. I want it to create a new SubMeasure Number which is the primary key and assigns the record the next available number.
Also if I try to add another record after one has been added I get runtime error "3021" - No current record. I would have to close the form and reopen for it to be able to add again.
I have attached the code below:
Private Sub cmdDuplicate_Click()Dim dbs As DAO.Database, Rst As DAO.Recordset
Dim F As Form
'Return Database variable pointing to current database
Set dbs = CurrentDb
Set Rst = Me.RecordsetClone
[code]....
View 4 Replies
View Related
Jun 20, 2013
I have a sub form that allows users to add staff to a project team, once added it populates a table which updates the subform showing the selected employee. I am trying to enable a delete function that allows users to remove an employee from the project team in the subform showing selected staff. Here is the code I have so far, but it doesn't work;
Code:
Private Sub Command4_Click()
Dim dbs As Database
Dim rs As Recordset
Dim sqlstr As String
Set dbs = CurrentDb
sqlstr = "DELETE tbl_CapexStaff.* FROM tbl_CapexStaff WHERE CAP_ID = Forms!frm_Switchboard.CAP_Live"
dbs.Execute (sqlstr)
End Sub
View 4 Replies
View Related
Aug 26, 2013
My subform consists of a list of tasks that are waiting to be verified. in order to verify tasks, the user scrolls through the list of tasks and checks a checkbox (discrepancyverified) on each record they wish to verify. After the user has finished checking all the records they wish to verify, they click a verify button on the main form which should then go back through each record and update the verifieddate value of any that are checked to today.
This is what I have so far:
Code:
Private Sub Command19_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim ctl As Control
Dim varItem As Variant
[code]...
View 3 Replies
View Related
Aug 25, 2006
hey, little prob for improving my database..
In a box on the form i have the date automatically entered. however it is also possible for people to change the date for say the day before or the day after.
SO what i really want is for the date to still autoset (most of the entries will be for the current day) but i also want two little arrows on the box (like standard scroll bar style) to give me whatever date in the future, or past, that i require.
at the moment this can be done manually, but i want to make it as simple as possible so no gets to befuddled!!!
cheers for the help (if anyone can)
Myle
View 2 Replies
View Related
Aug 11, 2015
I keep getting these annoying up/down arrows in the calculated control of a form. The top one is ok, but the bottom one has these. How do I get rid of them.
I've checked the alignment on the control properties in the form and the settings are the same in the table field properties.
View 2 Replies
View Related
Jun 5, 2013
I'm having some problems with VBA code I'm writing that references a subform. I'm pretty new to VBA and am not sure what the problem could be. The parent form (TrackingForm) tracks dates different tasks were completed. The subform (Child2) tracks exceptions that also need to be marked completed. I need ALL dates to be marked as completed before the entire tracking record can be marked as completed.
I have the following code entered into the OnFocus event of the tracking records Me.Completed_Date field:
Private Sub Completed_Date_GotFocus()
If IsNull(Closing_Date) Or IsNull(Package_Received) _
Or IsNull(Upload_By) Or IsNull(Initial_Review_Date) _
Or IsNull(Me.Child2.Form![Date Exception Completed]) Then
Me.Completed_Date.Locked = True
MsgBox "Completed Date cannot be entered - outstanding items.", vbOKOnly, "Warning!"
Else: Me.Completed_Date.Locked = False
End If
End Sub
What ends up happening is that, if there is more than one exception record on Child2, the code only seems to care if one of the records (usually the first record) has something entered in the [Date Exception Completed] field. I can't seem to make it look at any successive records in Child2 to ensure they are also completed prior to unlocking the Me.Date_Completed field. I have googled this extensively over the last day and the only response that seems to recur involves using a Recordset function that I have never used and am unsure how to.
View 4 Replies
View Related
May 4, 2015
I have a main form that controls 2 subforms. sbfActiveProjects displays a list of records that have not been flagged as complete. Upon clicking on a record in sbfActiveProjects, the details of that record show up in sbfProject. This functionality works great, except when I try to create a new record. The code works fine for getting a new record, however once I run the command I lose my ability to navigate to other active records.
Code:
Private Sub cmdNewProject_Click()
'set focus to sbfProject
sbfProject.SetFocus
'navigate to new record
DoCmd.GoToRecord , "", acNewRec
End Sub
View 2 Replies
View Related
Jun 13, 2013
I have a code that works great from the parent form but I decided to change the format and call it from a lostfocus event in the subform instead. Now I keep getting error 3314:"You must enter a value in the tbGuests.LastName field".
The code should copy the parent form fields and create x number of duplicate records according to a field on sub-form. It then runs an append query to add the information from the subform.
Code:
Private Sub GuestsInParty_LostFocus()
Dim partymsg As Integer
Dim dbs As dao.Database, rst As dao.Recordset
Dim F As Form
Dim intHowMany As Integer
Dim intCounter As Integer
[code]....
View 1 Replies
View Related
Feb 13, 2015
How do I display a more meaningful message instead of the cryptic error about having to enter data into blah blah blah. How can I trap that error and provide them a more meaningful message about entering data. I have tried the following;
Main form name frmPatientRecords
Sub form name DentalRecords Subform
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Nz(tblPatientDetails!recordid, 0) = 0 Then
MsgBox ("sorry. Please complete the main record entry")
Parent.SetFocus
End If
End Sub
View 14 Replies
View Related
May 17, 2013
In my forms I would often like to move forward or back a records, usually a date by keyboard alone.
The keyboard arrows are good but they are normally used to navigate along a line etc.
Page Up & Down again better & often used for moving between records but do sometime need there native functions.
Trying to avoid changing the functions of these keys depending of what part fo the form I am on or current function I an doing.
It would have been great if there was a Alt Left or Ctrl Left that gave a different ansii.
Alt N - next, Alt P - previous, not pretty.
View 5 Replies
View Related
Mar 14, 2014
I have a subform which lists a set of records. In the footer section of the subform, I have a number of controls which display calculations based on the records present.
The number of records in the subform will change (reduce). Basically, this is a review / approval function, the idea being that each record will be checked and approved, which will then remove it from the list.
So eventually, all of the records in the subform should disappear (the subform is requeried each time the user approves a record)
I want to be able to hide the controls in the footer section once the subform has been cleared of all records.
But not sure
a) how to determine when the subform's recordset reaches zero and
b) what event to use to fire the code to hide the footer controls.
This is my basic attempt :
Code:
Private Sub Form_Current()Dim ctl As Control
For Each ctl In Me.FormFooter.Controls
ctl.Visible = Not (Me.Recordset.EOF)
Next ctl
End Sub
But it doesn't work (it only seems to fire when the subform is loaded, not when it is requeried after each approval?)
I've tried Form_Query, Form_DataChange and Form_DataSetChange but no joy with those either.
View 6 Replies
View Related
Aug 4, 2015
The unbound Parent form has a listbox (SQL Server) , the selection updates the SubForm with a primary key ID. The Subform is a ReadOnly view from an Oracle Linked table. It populates with a Select * From Oracleview where ID = listboxID The code is at the link shown below update: The subform uses textboxes linked to the read-only record.
The main form can populate, no problem. However the SubForm data source is either populated OR is Null.
If it is Null, the subform stays blank. Two Objectives:
1. Set a boolean variable flag in the parent (main form) that subform record exist or that it is null. e.g. Parent obtain recordset count property from Sub form
2. Display the subform with blanks.
[URL]
View 3 Replies
View Related
Apr 13, 2005
I would like to have a combo box that doesn't show the drop-down arrow when the user selects it. You say, doesn't that defeat the purpose of the combo box?
Well, look. In a form I have a datasheet (in a subform) that only displays data, so it is locked from editing. Within the datasheet is a field that contains a combo box with a row source from a linked table, and the control source of that combo box is the primary key. Essentially I'm utilizing the combo box because it is smart, and allows me to display linked data: this combo box contains two columns, and I set the first column's width to "0" so that it would only display the field I want. I didn't use a subform because, in datasheet view, subform fields are not displayed in the linear fashion I need, but instead go hide under the "+" button for each record.
So, even though everything is locked from editing, the combo box arrow still appears when the user clicks on the combo box field, and I don't want it to. It's just misleading to the user. Anyone know how to disable the arrows? Or, if you catch my drift, do you know of another simple solution?
I'm not a keen programmer in case you couldn't figure that out. If you've got any VB tips then let me know.
View 7 Replies
View Related
Aug 23, 2006
Hi
I am compiling a database of my fire system 'engineers reports' by creating a form that is identical to the one that I print and give to the customer.
I used combo boxes to look up system type details, from another table, after inputting the serial number. As these combo boxes can only produce one value I hid the arrows behind background coloured rectangles.
When I print the form the arrows disappear, the combo boxes expand by the width of the arrow and the last 2 digits of right-aligned numbers disappear behind my rectangles.
This form has over 200 controls (systems types, parts used numbers and quantities etc) and I need to print it on a single sheet of paper. I cannot afford to leave extra space between my controls.
The only thing I can think of is setting the visible property of my rectangles to screen only, which is not ideal.
Any suggestions would be greatly appreciated.
Thanks
View 4 Replies
View Related
Nov 10, 2014
I have a subform in Continuous Records format (records displayed are determined by controls on the parent). I would like to create a button that prepares an email and copies the contents of that subform in to the body of an email message.
The email. I have a method to create a new email, set To, CC, Subject and even Message Text.
Code:
strTo = txtName
strCC = txtManager
strSubject = "Something"
strMessage = "Hi, please find below list of details from X Y and Z" & vbnewline & vbnewline
That all works. Thats fine
The Records: I have found ways to have them added as an attachment, either the the SendObject and OutputTo method but I would like the list of records to be converted to a text string so I can include it within my strMessage variable, not include it as an attachment.
Code:
strMessage = strMessage & "Subform Records to go here"...
View 7 Replies
View Related