Simple VBA Record Selection Problem
Apr 19, 2006
Hi,
I know this is very simple but I am unable to get it work.
I have a Form (based on Table "Trades") and on the Form is a Command button. The Command Button has a VBA Code which selects the items from the Table and coverts to a text file - this works fine but the problem is that I am unable to repeat the process for all records in the table. I have tried using Dim as Intergers and upto a number of records, but it does all records as the first record.
I also tried this:
Dim db as Database
set db as currentDb
- but it does not like it!
I know I have to set it as
Dim rs as Recordset
but when I set rs as CurrentDb.Recordsets it does not like it!!
Any help!!
Thanks
View Replies
ADVERTISEMENT
Apr 21, 2006
:mad: I have created a database to hold information on non conformances we have with our suppliers, I am really stuck, what I am looking for is to put a field into a table which counts issues with the different suppliers, if anyone can help it would be much appreciated! Thanks
View 1 Replies
View Related
May 2, 2005
I created a couple database tables to link with my RF scanner for use in a warehouse.
Is there anyway that I can take a masterfile table and select 100 records, cut them out and paste them into a new table to import into the handheld?
I am pretty sure there is a way, just don't know where to start. I didn't think the macro's had that functionality, and since I have very little VB programming I have been forced to rely on Access functionality.
Any help would be accpreciated.
View 1 Replies
View Related
Aug 22, 2005
Basic premise:
I'd like to list all records in a table accompanied by a checkmark. If the checkmark is checked then this record will be edited (saved to a 'list' for editing). If not checked, then the record will not be edited (not saved to a list).
What I've done thus far:
I have a table with all the fields in it (pulled from a master table) and the checkmark associated with each record on a datasheet form. That works..I can select each record using the checkmark and use mod code to check if the checkmark is true or false.
But what I would like to allow is:
Filtering on a field and allow the checkmarks to be selected individually as well as a 'Select All' button. Thus, when the form is first opened - all records appear. The user then 'filters' for all Telephone Number field starting with area code '222'. With that new set of records, the user can then select each record individually by checking the checkmark box and select all records by clicking the 'Select All' button.
As an example: Lets say a company with telephone number 222-xxx-xxxx recently moved to a new area code. Instead of changing each record individually - I'd like to list them, filter them down to '222', then perform a 'global change' to all records.
Hope that makes sense,
Thanks,
Charles
View 1 Replies
View Related
Aug 1, 2005
I have a Main Form
Main Form [Event],[Category],[Judge Name]
The Main Form also has a subforms
Sub1[Event],[Category],[Judge Name],[Score],[Comments]
On the main form I have a combo box that is set to retrieve records that meet the combo selection. and thus the subform is related to display the corresponding records.
In my selection combo box I see all of the various selections as follows
[Judge Name],[Category],[Event]
and it is bound to the judges name
Problem Example:
Pull Down Values
1.[Sherry],[Fitness],[Mrs. Canada]
2.[Sherry],[Swim Suit],[Mrs. Canada]
In the above when i pull down the combo box to select and I select the first example above all is wonderful ; however if i want to select the second row the [Category] and [Event] Do not change and the information i input into the subform ends up being associated to the wrong category.
How do i bind a combo box to more than one [field] on the form
I have over 50 hours into this DB to this point and this is critical.
View 1 Replies
View Related
Aug 14, 2005
Hi Folks,
I have a Main Form having a Sub Form on it, The Sub Form shows 3 rows of data or in simple words 3 records behind each page. I wish to select one of the three record and paste the data to a certain field. Lets say if the record have following fields: SNO ROLL NO EXPIRY
i wish to select this record by mouse and paste the ROLL NO field data to another field on the main form called APPROVED ROLL NO.
Hope Some one will help me
Regards
Darno
View 3 Replies
View Related
Nov 2, 2006
I'm sure this is easy but my name tells the story.
Can someone lead me in the correct direction.
I have a form tied to a table with three columns
Employee #
Employee Name
Employee Title
What I would like to do is have Employee # as a combo box. When an employee # is selected in the combo box the Employee Name and Employee Title would automatically update with the corresponding information on the table.
Thanks
View 8 Replies
View Related
Oct 12, 2007
Hi All,
I have a form that records quotation history for each customer in a data sheet format, which show previous quotes done with a quotation number. I also have a quote entry form to give use the unique quote number for each record. This is the form we also use to update and info from our reps.
Can I just use the history click quote number 12345 which closes the history form and opens up the quote update form for that record.
Thanks
Mike
View 11 Replies
View Related
Apr 21, 2006
:mad: it sound really stupid but I am having problems on open.
I have a main input page for the database I am creating but when I open it up it brings up previously inputted data.
Any ideas on this?
View 2 Replies
View Related
Jul 29, 2005
Hello,
I have a little problem and do require help in fixing it. I am only 3% away from finishing the database (due today) but have a little bit of a problem on my hands. here it is:
I have a counter on my form that tracks which record is currently being viewed. the code for the counter is:
------counter code---------
'Provide a record counter for using with
' custom navigation buttons (when not using
' Access built in navigation)
Dim rst1 As DAO.Recordset
Dim lngCount As Long
Set rst1 = Me.RecordsetClone
With rst1
.MoveFirst
.MoveLast
lngCount = .RecordCount
End With
'Show the result of the record count in the text box (txtRecordNo)
If Me.CurrentRecord = lngCount Then
Command126.Enabled = False
Command129.Enabled = False
Else
Command126.Enabled = True
Command129.Enabled = True
End If
Me.txtRecordNo = "Record " & Me.CurrentRecord & " of " & lngCount & " record(s) for " & [CLIENT PREFIX]
Me.Text292 = "Record " & Me.CurrentRecord & " of " & lngCount & " records"
----------counter code---------
On the same form, I have a delete button. The button deletes the current record that is being viewed (user prompted before it is deleted). The code for that button is as follows:
----delete code-----
Private Sub command271_Click()
On Error GoTo Err_cmdDelete_Click
DoCmd.SetWarnings False
If MsgBox("Are you sure you want to delete this Audit and its associated measures?", vbQuestion + vbYesNo + vbDefaultButton2, "Delete?") = vbYes Then
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
CLIENT_NAME.SetFocus
End If
Exit_command271_Click:
DoCmd.SetWarnings True
Exit Sub
Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_command271_Click
End Sub
-------delete code--------
This button also works fine with the exception of the following.
THE MAIN PROBLEM: example
I have a client that has 5 different entries in my database (5 diff. facilities) and I want to delete one of their facilities. I would simply use my 'search' form and then navigate to the facility that I would want to delete. If that facility is facility 1, 2, 3, or 4 then I have no problems. The system deletes the selected record and then simply displays the one after. The PROBLEM is when you are trying to delete the 5th record. When the fifth (in this example, it could be the 9th record for any other client, as long as it is the last one) is the one to be deleted, an error occurs. When you hit the debug button the following line from the counter is highlighted: .MoveLast
I have solved this problem and I no longer get an error message BUT when the last record is deleted, the database simply loads a new and empty form that will accept data. I DO NOT WANT THIS TO HAPPEN. I want it to be set up as follows:
If the last record (not the ONLY record, but the last record on file) is the one that is to be deleted THEN delete that record and load the one prior
If there is ONLY ONE record, then delete it and load the main form.
CAN ANYONE HELP.
View 3 Replies
View Related
Jul 1, 2006
Hello
I dont know if this is possible in MS Access (2003) but this is what I want to do...
I want to create a database, each record has about 8 fields.
Usual basic stuff for a typical DB so far...
BUT! One of the fields is the category info, say "Item 1"
Usage:
Now another 5 records are made and are childen of "Item 1" and called..say "1a" (..b,c,d,e)
Item 1d record has 300 sub nodes to it.. say "Item 1d1" (2 to 300). And so on to eventualy make many records but linked by a huge tree like structure (like Treepad DB).
Finding Records.
Now, to find say "Item 5c22f5" I just want to see 1 drop down list, I then choose "Item 5" from it.
Then a second drop down list appears with..say 8 child nodes of Item 5, I choose "Item 5c", 3rd drop down appears, I choose "Item...22"
etc, etc. till I get to my "Item 5c22f5"
Now, while sellecting each node, some nodes in other brances contained hundreds of items but I never want to see them unless I go through their brances.
Adding new records:
eg: While working on "Item 5c22f5" I decide to add a record which will be "Item 5c22f6", I want to simply add it within the same branch but not be expose to the hundreds of other nodes/records.
Then I also would like to now add a sub of the current and call it "Item 5c22f6a". and also be be confided to the current branch. Or if I just go in 3 brances deep & see 5 levels each etc.
Finally, each record will have a field called "Notes" but I want rich text formating (like in word pad would be fine).
Maybe the ID tagging fields could be 3x on each record to show forward, current & back nodes???
What ever it takes.
I hope I've explain this OK.
I am new to MS Access so if it cant do it, I dont want to spend time learning it for nothing (at least not now).
This (if sugcessful) will be my universal, mind mapping info base. A baby I've been dreaming of for years now. Like Infohander meets TreePad meets Advance Data Managment (ADM) meets FileMaker.
Not availble anywhere in anyform as I know.
Thanks in advance. (sorry about the spelling)
View 3 Replies
View Related
Apr 9, 2007
Hi there..
I am having issues with MS Word mail merge. Issue is i am selecting the recepient list from access database. then i filter the list as per my need and send emails. But filter is not working properly.It is sending email to all the of records not to only selected ones.
Can it be any issue with MS Access?
Thanks
Danny
View 2 Replies
View Related
Sep 5, 2005
Good morning all! I've got three bound combos set to visible = false on their property sheetsThese will remain hidden or will be revealed depending on the selection made in another bound combo cmbType.
The select case below works fine on the form but the selection affects all records not just the current record. Open record 1 and select "compliment" from the first combo - the three others correctly stay hidden. Move to record 2 and select complaint and the combos appear - Great! Move back to record 1 and they're showing there as well. Groan. Helllllppp!
Private Sub cmbType_AfterUpdate()
On Error Resume Next
Select Case cmbType.Value
Case "Complaint"
cmb2Day.Visible = True
cmb15Day.Visible = True
cmbOver15.Visible = True
Case "Compliment"
cmb2Day.Visible = False
cmb15Day.Visible = False
cmbOver15.Visible = False
Case "Suggestion"
cmb2Day.Visible = False
cmb15Day.Visible = False
cmbOver15.Visible = False
End Select
End Sub
View 1 Replies
View Related
Dec 13, 2006
Hi,
I am trying to update prices changes for products in my inventory database, and am stumped.
I select a vendor, which then populates the product name from which I can then select the product I want to update. From here, it populates what the current prices are. I then can type the new price into the next box, but what happens is that it doesn't change that Product it changes the 1st record.
Can anyone help!
View 3 Replies
View Related
Oct 18, 2013
I have a form that allows me to change the information for a list of personnel. On this form I have a list box that displays all the personnel in the list. There should never be more than 12-15 people in this list so it's an effective way of selecting records, however I can't figure out how to make the form select the record that is tied to that person from the list.
In VBA I've tried creating an "On Click" command for the list that, when a name is selected, is brings up the corresponding record. I thought I could use a DoCmd.FindRecord but I guess I don't quite know what I'm doing. I didn't want to use SQL to limit the records to just the one that matched I wanted to keep it simple if possible.
Code:
Private Sub Personnel_List_Click()
DoCmd.FindRecord Personnel_List, , True, , True
End Sub
The Personnel_List box is tied to the Personnel_Table, and the table only displays the names available.
View 3 Replies
View Related
Apr 12, 2005
Hi... I searched quick, didn't find anythign, but you guys are so responsive... :D
Question:
Part 1. On TimeSheet form, I want to click to "create new job", and the Jobs Form opens, at a new record. Currently it opens at record 1.
Part 2. I foresee that when I return from the modal job form, the old form (timesheet) would not have updated the combobox to show the jobname I just entered.
I guess this is what subforms are, because I keep reading about them, but dunno what they are.
Thanks
-Reenen
View 5 Replies
View Related
Jun 20, 2014
I am trying to add a record through a form, and then get that last record and print it via a simple report.
I keep getting debug when I run it. My add record sub works fine, but the dlookup doesn't work when I put the add record sub in.
Private Sub addRecord()
On Error GoTo errHandling
'INSERT CODE
Dim dbOpenTrades As DAO.Database
Dim rstTrades As DAO.Recordset
[Code] .....
View 1 Replies
View Related
Jan 8, 2006
right, struggling here.
Basically I have continuous form listing all the standard letters sent out when I double click on a letter, I need to to run a query for me. The code I have put behind the button is:
If ([StandardLetterType] = "Homework") Then
DoCmd.OpenQuery ("qryHomeworkClearMailMerge")
DoCmd.OpenQuery ("MergeHomework"), , , , , acDialog, Me.[StandardLetterID]
DoCmd.OpenReport ("rptHomework"), acViewPreview
Else
'
end if
and in the query I am first clearing the mailmerge yes/no field out which works fine and then running the merge to put the yes back in the current record so the query looks like this
Its an update query with update to yes for mailmerge and under the standard letter ID i have the criteria [Me].[OpenArgs]
is this completely wrong tried the [Forms!][frmFullStudentReport].[standardletterID] but it kept popping the box up asking for the number.
On the form I have the standardletterID and its hidden but there.
Any help would be greatly appreciated
View 1 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
Jan 18, 2006
Right slightly complicated (in my eyes) and I have not found anything in previous threads to help but here goes:
I have a main form (FRM_SUMMARYREVIEW) that has an unbound subform field on it (subfrmmaster).
When FRM_SUMMARYREVIEW is first opened subfrmmaster has its sourceobject set to a form called FRM_OPENSUMMARY.
This subform lists all my open escalations, in a continuous forms format and has a field in it called "escalationid" and when I click this field "subfrmmaster" changes it's sourceobject to another form called FRM_MAINDATA and should display the data relevant to the escalationid I have just selected.
In the past I used to click on "escalationid" and it opened up FRM_MAINDATA as a new form, using the following code:
Dim Searchstr2 As String
Searchstr2 = "[Escalation ID] = " & Forms![FRM_SUMMARYREVIEW]![FRM_OPENSUMMARY].Form![escalationid]
DoCmd.OpenForm "FRM_MAINDATA", acNormal
Forms!FRM_MAINDATA.Filter = Searchstr2
Forms!FRM_MAINDATA.FilterOn = True
However how can I get the subfrmmaster sourceobject to change and display the relevant escalation detail ?
My other option is to have two subforms on the main form, one with "FRM_OPENSUMMARY" the other with "FRM_MAINDATA", as "FRM_OPENSUMMARY" has a list of escalations displayed, in a continuous forms format could I set it so as I arrow down the list, the data in FRM_MAINDATA displays the highlighted escalation in "FRM_OPENSUMMARY".
I hope this makes sense
MattP
View 5 Replies
View Related
Mar 9, 2006
hi,
i have a form that uses combo boxes for entry, some of the combo box entries are dependent on preceding combo box selections.
i have managed to make the combo boxes present options based on the previous selections, but am finding that after i move on to another record, some of the combo box entries are not being retained or stored in the record.
It happens only on some records and sometimes when I return to it again the selections are there even though on a previous ocassion they were not.
Can anyone suggest what may be causing this?
Regards
K
View 5 Replies
View Related
Sep 26, 2006
Hi,
Need help on a list box issue. Solution is probably real simple, just can't see it with my bleary eyes.
I have a form (INSTLKP) with only a list box (List6) based on a table ((tblPersData) with fields PersdataID; SSN; Last; First; MI) on it. When I open the form up, the listbox does display all records associated withthe table. I would like to doubleclick on a desired SSN in the list box and have that record open up in a form (Perssub1) in edit mode.
And that is where the rub is... I have the following code in the On doubleclick event of List6
Private Sub List6_DblClick(Cancel As Integer)
DoCmd.OpenForm "Perssub1", , , "[PersDataID]= " & Me.List6, , acWindowNormal
End Sub
All it does it just open a blank Perssub1 form. Any ideas on what I'm missing?
:confused: Hawg1
View 6 Replies
View Related
Mar 25, 2015
I have 1 combo box contains 2 columns look-up directly from the properties(Not VBA)
Now i want to select record from the list
Example: i want to select PM-1234-1111 so i dont want to type starting letter PM to select but i want to type 234 or 123 or somewhere in the middle or end to filter that contained text in all the items is it possible?
Any Property settings or any VBA code?
View 1 Replies
View Related
Jan 13, 2015
it's easy to set up a form with a combobox that will list all records and moves the user to the selected record. But I can't figure out how to just show a selection of the records in this combobox, instead of all records.
So, to use the example used in most online tutorials: a drop down menu shows you all the names in a customer database. However, I'd like to have instead a dropdown menu with an overview of all surnames in the database and that I move to the first record with the selected surname.
View 1 Replies
View Related
Apr 14, 2014
I am working on a volunteer organization's database, and am trying to create capacity to print an invoice for a donation pledge. I have a sub-form that displays donation records for a selected individual. From the sub-form I have created a command button with an OnClick event procedure with the following code:
DoCmd.OpenReport "Reports![RadThonInvoiceR]", acViewNormal, , "MasterID= " & Me.MasterID
ID Year Amount Status
53 2008 $200.00 Paid
53 2009 $200.00 Paid
53 2013 $200.00 Unpaid
Can I modify my Where condition so that the report selects only the most recent entry (by Year) from among the current selections?
View 8 Replies
View Related
Jul 21, 2005
I have a form with a drop down list, when the user selects an option and press a button. I would like to add the value of the drop down list to a table as a new record.
Thx :mad:
View 2 Replies
View Related