Record Navigation/Combo Box
Feb 15, 2005
I am trying to do a search for my Access form using a combo box. It works when I search by a field called institution. But I want the records to be displayed in descending order by date rather than by Id. What should I add to my code.
Code: Private Sub Combo21_AfterUpdate() Dim rs As DAO.Recordset Set rs = Me.RecordsetClone rs.FindFirst "[INSTITUTION] = """ & Me.Combo21 & """"If rs.NoMatch ThenMsgBox "No Act Account for company selected."Else 'Display the found record in the form.Me.Bookmark = rs.BookmarkEnd IfSet rs = NothingEnd Sub
Also I want users to perform a search by selecting an institution from one combo box then a date from another box. Any help on this would be greatly appreciated.
Thanks in advance forum
View Replies
ADVERTISEMENT
Nov 28, 2014
Can I use combo boxes placed in the detail area of a navigation form, above the sub menus but below the navigation? I am not able to get one to work properly . I can set it up but when I run the form, and try to pick an item from a list, it will not work...
View 2 Replies
View Related
Aug 13, 2014
I have a combo box combo51.
If I open the form directly from the left pane (all access objects)
forms engineering entry
the form opens and combo51 has focus (the cursor is in it)
If I open it from the Engineering tab on the navigation bar the Engineering Entry is the default left hand form and opens, but no focus as in the screen dump.
If I go to the code on Engineering Entry, On Load, Combo51.SetFocus This doesn't seem to work as I would expect.
How can I get this combo box to get focus when opening this form via the navigation bar.
View 14 Replies
View Related
Feb 1, 2008
Hi,
How can I iterate over all the records in a table and get each value from a field in each record? I want to get each value from the field, do something to it, then add it to a combobox. Is there a way to do this simply?
v/r
Mike
View 1 Replies
View Related
Nov 10, 2005
Hi,
i have a combobox with two subforms and 1 main form.
the mainform is based on a query
When i scroll, the records change, and the subforms corespond properly.
BUT, when i use the combobox to change the records, i cant select anything. I see the list in the combox, but when i click i get the message:
Cannot change value. Type autonumber.
please help
View 1 Replies
View Related
Dec 5, 2005
Hi
Can i get rid of the record navigation bar at the bottom of a form? if so i can have a control button that will go the next record but how can i stop 2 people going to the same record?
Any ideas?
Thanks
B
View 1 Replies
View Related
Feb 13, 2006
Ok, I am trying to make some sort of thumbnail preview form. The image appears in the imgBox no problem, and it is grabbing it from the field. When I use a combo box to navigate the records it works flawlessly
HOWEVER, I would like my users to be able to press bckwds/fwds arrows so i made some arrows with the wizard and added some code. Heres how it looks
---------------------------------------
Private Sub cmdNext_Click()
On Error GoTo Err_cmdNext_Click
DoCmd.GoToRecord , , acNext
Me.Requery
If Me!SamPhoto = "" Or IsNull(Me!SamPhoto) = True Then
imgSamPhoto.Picture = ""
lblNoPhoto.Visible = True
Else
lblNoPhoto.Visible = False
imgSamPhoto.Picture = Me![SamPhoto]
End If
MsgBox Me!SamPhoto
Exit_cmdNext_Click:
Exit Sub
Err_cmdNext_Click:
MsgBox Err.Description
Resume Exit_cmdNext_Click
End Sub
Private Sub cmdPrevious_Click()
On Error GoTo Err_cmdPrevious_Click
DoCmd.GoToRecord , , acPrevious
Me.Requery
If Me!SamPhoto = "" Or IsNull(Me!SamPhoto) = True Then
imgSamPhoto.Picture = ""
lblNoPhoto.Visible = True
Else
lblNoPhoto.Visible = False
imgSamPhoto.Picture = Me![SamPhoto]
End If
Exit_cmdPrevious_Click:
Exit Sub
Err_cmdPrevious_Click:
MsgBox Err.Description
Resume Exit_cmdPrevious_Click
End Sub
Private Sub Form_Load()
DoCmd.GoToRecord , , acFirst
End Sub
------------------------------------------
My problem is that it never goes to the second record when i press next, and when i press back it says at end of recordset ( which makes sense ) but why would the back button work, and the fwd button do nothing ? I am hoping it is a small syntax error. Please help!
View 6 Replies
View Related
May 10, 2006
In a Form, can I change the label of the Record Navigation from "Record" to something else. If so how or where do I go to change it
View 1 Replies
View Related
Oct 16, 2006
Hi there I found alot of nice tips here, thanks for that :) But I havent found exactly what I am looking for. I will keep searching but I thought I would post as well.
Here is my problem : I have to design a form that works like an old application form written in VFP7.
Basically a combo box chooses a customer, another combo box filtered by customer chooses a job. A third combo box filtered by Jobs chooses a stock.
There is a subform linked by Stock_ID that displays details of the stocks, amounts, locations, etc...
I want to limit record navigation to these combo boxes. Right now even with navigation buttons hidden and limiting tab cycle to current record; a user can use the mousewheel and page up / page down keys to change the current record in Stock table and thus changing the details in my sub form.
Does anyone know of a way to stop all record navigation unless I explicitly move the record pointer via code behind the combo boxes?
I will keep looking around here and will likely play with the Current event to reverse any changes made to the record pointer but it does not seem the best way to handle this.
Thanks much :)
ps Im using Access 2003
View 2 Replies
View Related
Nov 27, 2005
Rather than using the 'Navigation' offered by MS Access I would like to have 2 text boxes, one that shows the total number of records in a recordset (DCOUNT works here) and one that shows the number of the current record, incrementing or decrementing as I click on the 'Next' and 'Previous' command buttons.
Does anyone know if there is there a function that does this?
Thanks ...
View 1 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
Feb 6, 2006
Hi all,
We have an Access 2000 db on a server that I can open.
Problem is, when other users open it up and use the Navigation buttons to say, view the next record, Access crashes with the following error:
"Method 'Requery' of object '_Subform' failed." (this is the Access supplied record navigation functionality - I havent customised it in any way)
Other users have been using it before with no problem (upto last week). I can still open the db and do not have any errors...
So, it appears to be a user related problem.
Any suggestions or things I should check out, please?
Many thanks,
View 6 Replies
View Related
Jul 20, 2006
Hi
I have a form with a button and a text box
The control source for the text box is a Number field called FileNo in a Table called File. THe default value of the text box is 0.
When the button is clicked a value is calculated using the last value under FileNo in the Table.
The problem is that I have to either navigate the records or close the form in order to save the new value onto the Table.
I need to be able to save a new value to the Table as soon as it is generated without having to close or navigate. So that I get some new value everytime I click the button without closing the Form.
(when the button is clicked 1 will be added to the last value under FileNo on Table File)
ViRi
View 2 Replies
View Related
Jul 20, 2006
Hi
I have a form with a button and a text box
The control source for the text box is a Number field called FileNo in a Table called File. THe default value of the text box is 0.
When the button is clicked a value is calculated using the last value under FileNo in the Table.
The problem is that I have to either navigate the records or close the form in order to save the new value onto the Table.
I need to be able to save a new value to the Table as soon as it is generated without having to close or navigate. So that I get some new value everytime I click the button without closing the Form.
(when the button is clicked 1 will be added to the last value under FileNo on Table File)
ViRi
View 3 Replies
View Related
Mar 25, 2015
I am using Access 2007 and am a former user of an old flat-file 32 bit program under Windows 3.x. I am fairly new to MS Access 2007. I run a filter or query, which will return X number of records. Then, I will search those X records by specific text, such as "assist" from the record navigation buttons. I search for "assist" and the text will be highlighted each time it is found in any text or memo field in the record. Hitting Enter takes me to the next occurrence and highlights the text. If "assist" occurs in 4 fields in a record, for instance, it will be highlighted in each of those 4 fields one by one as I hit Enter. The next Enter takes me to the next record and will then continue to the next occurrence of assist" in any of its fields. It will continue to highlight "assist" in those fields, in succession, until the last occurrence in all of those records is found, in which case Enter does not return "assist" anymore because the last occurrence has already been found.
This does not always work. Often, I get every occurrence of "assist," but in the current record only, even though the word exists in other remaining records that were returned with my original filters/query.
View 1 Replies
View Related
Dec 16, 2013
I've spent far too long searching for the answer to this. On my form's onCurrent event I want to check if I am on the last record and if so, disallow navigating to the next "record" which is blank. I'm not sure why Access will let this happen to begin with when selecting Next Record. Isn't that what New (blank) record is for?
View 11 Replies
View Related
Dec 16, 2005
I have a subform in datasheet view.
Would it be possible to change the text 'record' to 'Line'? If so how?
View 2 Replies
View Related
Jan 17, 2006
Hi, I have a form and want to change the background color and the record scroll/navigation button colors.
Changing the background color is easy; just go into Design View, right click, and change the "background color" properties.
Changing the record select button (on the bottom of the form) is more a challenge for a newbie like me. Does anyone know how to do this? Thanks
Help appreciated.
View 3 Replies
View Related
Sep 29, 2014
how to set a subform or table in a form that has no navigation at all?
View 12 Replies
View Related
Jul 11, 2014
To briefly explain my database; it is a bespoke referral management system within a hospital. Each record on the database contains patient demographic information, as well as information on their referral (i.e. date of referral, date of assessment, date of commencing treatment, discharge date etc.) Therefore, the same patient will appear multiple times in the database, with each separate record corresponding to a unique referral pathway.
The database forms are split to show patient information at the top, with referral information shown in a subform. I am trying to add navigation buttons to the subform that will allow the user to scroll through the referrals corresponding to the patient currently displayed on the main form.
Each patient has a uniquely identifiable number associated with them, and so it seems straightforward enough in my mind to have a button that will search for the record in the database where the patient's number matches the patient number of the current record, and where the referral date is minimum (for "First Referral"), maximum but less than current (for "Previous Referral"), minimum but greater than current (for "Next Referral"), and maximum (for "Last Referral").
View 5 Replies
View Related
May 31, 2014
I have made a navigation form that prints the current record out as a PDF and also the option to send the current record by email as a PDF. Both work perfect when you open the form outside the navigation form. But when you open it inside the navigation form, it does not print any of the information.
The problem is in the Query report, In the criteria box for field [RequsetID] it has
Code : [Forms]![FRMRequestForm]![RequestID]
(The above works outside the navigation form.)
I have also tried adding the navigation form name
Code : [Forms]![Main]![FRMRequestForm]![RequestID]
But none work.
View 4 Replies
View Related
Jun 2, 2013
I have a data base in which there is a table where each record describe properties of one fishing trip. The first column in the table is a number (unique but not autonumber format) and I already made 10,000 records with only this index number . Now me and others in my lab are entering data to this table for each of the records.
The data entry is done using form which show one record at a time (lets call it "sail_info_F").
I made another form which has only two elements:
1. text box in which I enter a number
2. button which opens the data entry form ("sail_info_F") showing the record with the same index number as the number I enter on the text box.
(the code for this button is "DoCmd.OpenForm "sail_info_F", , , "[RECORD_NUMBER]=" & Me.TEXT_BOX_NAME"
So far so good and it does open the form in the wanted record. BUT when the form opens I can't use the buttons I have placed in this forms which move between records. Those were made with the wizard, and are working OK when I open the form directly without using the second form (The one which opens "sail_info_F" on a specific record).
View 2 Replies
View Related
Nov 15, 2014
I am not able to disable NavigationButton when i login navigation form using login form. I am using MS access 2007 - 2010.i am using below code but getting error.
Forms![Navigation Form]!NavigationButton13.enable = False
Error
Run-time error '438'
Object doesn't support this property or method.
Any other method to disable NavigationButton.
View 2 Replies
View Related
Mar 31, 2014
I have a form that currently uses a "catch all" table for listing available equipment to choose from for an equipment field. I call it tblEquipment. What I want to do is to make it so when I type a name in (1 of 35) in one field of the current record, the record source for the equipment field immediately looks at a different table that has equipment available only for that name. To do this I plan on making 35 different tables with limited data originally found in tblEquipment. I would call these tblEquipment1, tblEquipment2, etc. I do not use a sub form, nor do I want to.
So my questions are:
1) can this be done
2)If it can be done, how can I do it?
View 3 Replies
View Related
Oct 28, 2014
I have a problem with my database I have a combo box that will search for my record. Actually its working I input the specific number it goes to the specific record. But I want, if there no existing record in my database it will display a Messagebox that "No record Found" I try to put a code in a macro builder in a after update property field but nothing happened.
Expression code that it will display the msgbox if there's no record found.
the given code from macro builder is attached. I try to have an if else statement but I dont know how to not equal that giver conditional expression.
View 10 Replies
View Related
Apr 24, 2005
on main form i have 6 buttons to take me to different forms. these other forms display different details relating to the same record im looking at on main form.
SO, i hit the record navigation button and it flicks to show record 2's details, then i hit my button and it takes me to my new form BUT starts from record 1, i want it to show the current record in looking at on main form.
i feel ashamed asking this, must be simple thing to do.
thank you for any advice.
View 3 Replies
View Related