Changing Navigation Recordsource To Query

Apr 10, 2006

Hello,

I'm trying to create navigation buttons that navigate in alphabetical order. I know that the easiest way to do this is by creating a query and using the query as the recordsource for my navigation buttons, but for the life of me I cannot figure out how to actually change to the recordsource to that query for only that navigation button.

I'd appreciate any help

Thank you
PRHC

View Replies


ADVERTISEMENT

Changing Recordsource Then Go Back To Original - Query Is Faster

Oct 11, 2006

Hi
I have some drop downs on my form, which has some code that decides which recordsource to use.
When I first select an option from the drop down, the query takes 10 seconds to load data.
I then select another option, which runs a different query, which takes x seconds.
If I then select the original option from the dropdown, the data loads onto the form in less than a second.

Why is there a delay the first time round and not the next? Has Access saved some kind of query plan? If so, why doesn't it save it permanently?

View 1 Replies View Related

Changing Subform RecordSource Will Not Stick

Apr 18, 2005

Weird yet aggravating problem.

I am trying to setup a routine that will allow the user to change the RecordSource of a subform. The RecordSource is being changed yet once I move to another record the subform is reverting back to the original subform RecordSource. I am using the below command to change the subforms RecordSource...

Me.MySubformName.Form.RecordSource = MySQL
I even to make a copy of the subform and I changed the table it is linked to yet I got the same result

Me.MySubformName.SourceObject = "MyOtherSubForm"

There are no functions in the record selectors that would interfere with the subforms RecordSource.

Any suggestions as to why the RecordSource of my subform will not "stick" when I move to another record?

Thanks in advance for your help!

View 8 Replies View Related

Changing Subform's Recordsource With OnCurrent

Jun 29, 2005

Hi

I have problems working with a 3 level form

I have one main form called Projects

Depending on the record on the form Projects, the subform called Products will display the correct info

And on the OnCurrent event of the form Products, it will display the correct info for another subform called Product_Info

The problem is, the subform called Product_Info is dependant on a field on the Projects form, and on a field on the Products form so I cannot directly link the Product_Info form with either the Projects of Products form

What I'm doing is changing the recordsource of the Product_Info subform on the OnCurrent event of the Products subform but for some reason it won't work

If I display the recordsource of the Product_Info subform, it displays the right recordsource triggered on the OnCurrent event of the Products subform, but the data doesn't display

Thanks

View 3 Replies View Related

Forms :: Changing RecordSource Of A Form Based On Field Values?

Feb 16, 2014

I have a simple add form that will add an entry to one of two tables: Box 1-1, or Box 1-2.

They have the exact same fields. In the add form, I want the user to specify a Rack field and a Box field. Box 1-1 would be Rack 1, Box 1. Box 1-2 would be Rack 1, Box 2 (there will be more tables later, but just using two for now until I get it working).

But right now my form always adds to the table Box 1-1 - I can't get it to switch.

I've added the code I have so far below. The first part is what I'm having trouble with, the second part just uses a Submit button to add a new record - I'm just including it in case it's interfering in some way I'm not seeing. I'm running Access 2007.

Code:
Private Sub Switch_BeforeUpdate()
If Me.Rack.Value = "1" And Me.Box.Value = "1" Then
Form_Add.RecordSource = "Box 1-1"
ElseIf Me.Rack.Value = "1" And Me.Box.Value = "2" Then
Form_Add.RecordSource = "Box 1-2"

[Code] ...

View 7 Replies View Related

Changing Color Of Record Navigation Button

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

Field With Data From A Different Query Than RecordSource

Aug 31, 2005

I have a form that pulls data from a big joined RecordSource query. This form needs to be editable. I need to add a field on the form that will contain a value, which is actually the sum of numbers from several records. Because that sum value includes arithmetic in the query itself, I'm assuming that is why the results of the query are not editable. I tried joining the Query that gets that sum value into the main RecordSource statement, but because the sum Query is not editable, doing that renders the whole form uneditable.

I am new to working with Access forms, and VBA in general. I have a lot of experience using VBscript, though. I was asked to get this done and now I have to fight my way through it. I'm hoping there is maybe a way to write a function that will query for the sum value based on the current ID on the Form. The main form cycles through records, and the sum value is a total of points for the record shown in the form. So as each record loads into the form, I need to get the points total that matches that record's ID and display it. The points total does not need to be editable.

Any suggestions for a newbie on how to solve this?

View 2 Replies View Related

Forms :: Only Turns Up 1 Record When Recordsource Is Query

Dec 18, 2013

I didn't have this problem when I had used subforms, but there were little bits of thins I had to polish. There are basically 2 tables, and the form is based on the table PKing. It shows the PK and a few irrelevant fields. However, when the recordsource now inner joins the two tables based on the PK, it only turns up 1 record.There are no filters, and nothing is spelled wrong. I checked all of the control sources, and nothing's off. What am I doing wrong?

The one record that is shows is perfectly fine.

View 7 Replies View Related

Change Recordsource Of Subfrm To Another Saved Query OnOpen

Aug 18, 2006

How do i make my subfrm record source switch to another saved query (qryPendingStatus) when it's opened from the form.

Heres what i am trying to accomplish:
I have a subfrm that i'd like to use to display info in 2 different forms.

There's a form currently for All statuses. Then another new one for Pending status. I'd like to use the same subform for this pending status form also, and in doing that my qryAllStatuses, but change to qryPendingStatus on the subfrm when i open the mainfrom.

This is on the open even ofthe mainform, but does not work (says method not founds...so obviouly i can't use ".Recordsource" here:
Private Sub Form_Open(Cancel As Integer)
Me.subfrmJobInfo.RecordSource = "qryPendingStatus"
End Sub

How can i make this happen?

View 3 Replies View Related

Forms :: Not Able To Disable Navigation Button When Login Navigation Form

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

General :: Navigation Control With Query?

Jan 21, 2013

I have a form for testing purposes only it is named "Navigation Form". It has a tab called WorkingInitial. Within WorkingInitial I have a form called QueryTester. With a list box called List0.

Basically I want to click on the tab and the query to automaically filter based on the criteria I create. I dont want to have to create a bunch of forms with each seperte query. I want VBA to modify the Query.

This is what i have an I have no clue why it doesnt work or what I am missing.

Code:
Private Sub WorkingInitial_Click()
Dim strSQL As String
List0 = strSQL
strSQL = "SELECT * FROM [Table1 Query].[My.StatusInitial] WHERE StatusInitial = 'Working';"
End Sub

View 5 Replies View Related

Queries :: How To Refer To Parameters In Navigation Forms In A Query

May 20, 2013

I did a query which parameter is written in a text box - tprj. This text box is in a form, which is in a navigation control, which is within another navigation control. How can I refer, in the query, to this text box?

The navigation forms are nmain which contains nprojects.

nmainsub and nconsultprojects are the navigation subforms
fprjconsult is a normal form, which is inside nconsultproject

I tried the following criteria:

[Forms]![Nmain].[form]![nmainsub].[form]![nprojects].[form]![nconsultprojects].[form]![fprjconsult].[form].[text4]

And

[Forms]![Nmain].[form]![nmainsub]![nprojects].[form]![nconsultprojects]![fprjconsult].[form].[text4]

And

[Forms]![nmainsub]![nconsultprojects]![fprjconsult].[form].[text4]

And

[Forms]![Nmain]![nmainsub]![nprojects]![nconsultprojects]![fprjconsult].[form].[text4]

And other forms too but I can't get it right.how to refer to forms inside navigation forms, inside navigation forms, in SQL? What are the rules for writing it clearly?

View 5 Replies View Related

Forms :: Update Query From Subform On Navigation Form

Jun 17, 2013

I have a navigation form, a navigation subform, and then a subform. When I click the save button on the navigation subform, i need the data entered in two fields on the subform to save in a table. the subform is based on a query. This is what I currently have on the the button's onClick event:

Code:
Update data_tbl
Set [data_tbl].[Approved] = [Forms]![Navigationfrm]![Navigation subform].Form![Entry_subfrm].[Form]![CboAppd]
[data_tbl].[Comments] = [Forms]![Navigationfrm]![Navigation subform].Form![Entry_subfrm].[Form]![txtComments]
WHERE [data_tbl].[ID] = [Forms]![Navigationfrm]![Navigation subform].Form![Entry_subfrm].[Form]![ID]

View 3 Replies View Related

Forms :: Criteria In Query Does Not Work With Navigation Form

Oct 23, 2014

how the Forms work I am trying to put some of them in Navigation Form and my commands does not work as they did in Form."Home app" is the navigation form, "Apeluri_neinchise" is the subform of "Home app" and "Combo1" is the criteria based on which a query shows a specific data.

What is the proper formula for query criteria?

[Forms]![Home app]![Apeluri_neinchise].[Form]![Combo1] (I tried this but it's not workink)

View 3 Replies View Related

Reports :: Navigation Form - Passing Query Parameters To A Report

Aug 4, 2014

I have a navigation form that will have 6-8 tabs. We were using about that many databases, but we are finally consolidating them into one. The result of us using so many databases has been the multitude of forms and reports that were necessary for each database prior to merging them together.

The problem: There will be anywhere from 12-20 (text boxes) that the user can use to search anything in our database. What we need to have happen, if possible, is for those search parameters to show up in the header of our report if they have text in them. If the text box is blank, it should not show up in the header of the report.

I have read how to to do the start/end date technique, but I do not know if that would work for what we are doing since the boxes would only show up if they are populated by the user.

View 4 Replies View Related

Forms :: Navigation Form Goes Blank If One Query Returns 0 Records

Jun 7, 2013

I have a tabbed navigation form. I have a form on one of the tabs, [tab1frm] that a query that consists of 6 fields that are each from a different query.as the record source. This shows a percentage field, an image field, and a count field for current month and then then the same fields for year-to-date.

The problem is that when there are no records for the current month, the whole form [tab1frm] is blank. I read that if no records are returned this can happen, but since there are always records returned for year-to-date, I don't know why its happening. Is there any way to make blank fields show up or to show the most recent records so the form is never blank?

View 6 Replies View Related

Using Sql To Set A A Reports Recordsource

May 18, 2006

Using this code as part of a module to open a report in print preview and set it's recordsource to the sql I have written earlier in the code. The problem is when I run this it only prints the report it won't show it to me in print preview like I want. Anybody know what's wrong? Thanks...


DoCmd.OpenReport "SitesIssues_qry", acViewNormal, "", "", acNormal
Me.RecordSource = strsql & " " & strWhere & "" & strOrder

View 2 Replies View Related

Setting RecordSource In VBA

Jan 26, 2005

This is driving me mad. I'm trying to copy a table and form from a template.
They both copy fine, but when I try to change the new forms recordsource property, nothing happens.

Private Sub CreateQuiz_Click()
'copy structure from existing BLANK table
a = InputBox("Name of new table", "Create new Quiz")
DoCmd.CopyObject , a, acTable, "BLANK"

DoCmd.OpenForm ("BLANK")
Forms!BLANK.RecordSource = a
Forms!BLANK.Close
DoCmd.CopyObject , a, acForm, "BLANK"
Forms!a.RecordSource = a

End Sub

Any help would be much appreciated.

View 1 Replies View Related

Setting RecordSource

Jan 27, 2005

Hi All
I have a Main Form, This Main Form has a Subform, the SourceObject for the subform is another form.
What I am trying to do is to set the RecordSource for the SourceObject Form from within the code behind the main form so i can use the same form with various queries.
Appreciate any help - thanks

View 2 Replies View Related

Listbox Recordsource Value

May 27, 2005

How do I determine what value my listbox has?

Here is what generates the records from Form 2:

If Not IsNull(Me.[StartDate]) And Not IsNull(Me.[EndDate]) Then
strCriteria = strCriteria & "tblWO.Created Between #" & _
Format(Me.[StartDate], "m/d/yyyy") & "# And #" & _
Format(Me.[EndDate], "m/d/yyyy") & "#"

strSql = "SELECT DISTINCT [WOnumber],[Requested],[UDF1],[RequestedBy]," & _
"[Status],[property],[asset]" & _
"FROM tblWO " & strCriteria

Forms("frmFilter").Listbox1.RowSource = strSql

What I am trying to do is trigger a message box from the onclick of a command button on Form 2 and read the listbox # records on Form 1. It's gotta be something simple in my syntax. Search hasnt provided this scenario for me. I have tried these and more:

'If Forms("frmFilter").RecordsetClone.RecordCount = 0 Then
'If IsNull(Forms("frmFilter")).Listbox1 Then
'If Forms("frmFilter").Listbox1.RowSource = 0 Then
'If Forms("frmFilter").Listbox1.RowSource = Null Then
'If [Forms]![FrmFilter]![Listbox1.recordcount] = 0 Then
'If Forms("frmFilter").Listbox1.RecordCount = 0 Then
'If Forms("frmFilter").Listbox1.RecordCount = "" Then
'If Forms("frmFilter").Listbox1.RecordCount = Null Then

MsgBox "Sorry, no records meet your chosen dates. Change the dates and try again."

View 2 Replies View Related

Recordsource Of Subform

May 30, 2005

Hi everybody,
I have a form with its tabbed subforms' recordsource determined by the code:

Private Sub childTvl_Enter()

Me.childTvl.Form.RecordSource = "SELECT * FROM tblTvlInput WHERE tblTvlInput.Dept = """ & Forms.frmBudget.txtDept & """"

End Sub

This is to filter the huge data by department and only allowing the specified department to view their code. However, I find it slow and pesky as it only shows the required information when the user clicks on the child. I have tried putting the code above elsewhere but to no avail.

Is there a better way of speeding the filter as well as showing the user his own records when he clicks on the tab?

Thanks in advance. =)
You guys here are saviours!

View 3 Replies View Related

Recordsource Delima

Sep 26, 2005

I am trying to correctly code a Record Source value in a Form's 'On Open' Event . I first captured parm data from the calling Form, (Last Name, and First Name) to be used in the query as follows:

Private Sub Form_Open(Cancel As Integer)
Dim intI As Integer
intI = InStr(Me.OpenArgs, ";")
SearchFirstName = Left(Me.OpenArgs, intI - 1)
SearchLastName = Mid(Me.OpenArgs, intI + 1)
Me.RecordSource = "SELECT tblName.LastName, tblName.FirstName WHERE tblName.LastName = SearchLastName and tblName.FirstName = SearchFirstName"
End Sub

If I leave off the 'WHERE' clause, I get all the records in the table, so I am sure the syntax in that area is all wrong.

View 2 Replies View Related

Set Forms Recordsource

Nov 24, 2005

Is there a way to set the recordsource for a form before it opens? I've got Me.recordsource = "QryNewCaseForm" on the On Open event of the form but I toggle between recordsources once the form is open and if I close it while the recordsource is "QryCaseForm" it won't open as "qryNewCaseForm" the next time I open it.

View 2 Replies View Related

SubForms RecordSource

Oct 31, 2006

Today my client asked me to do something strange.

He wanted a field to be in the subform which was originally part of the parent form and is still part of the parent table.

(Hence, when I change the field in one subform line it would change for all other subform lines related to the current parent record) He insists to put this in the subform and it should be Editable there.

I accomplished this by basically putting a 'Parent table' join 'Child table' query in the subform so I could have access to this one field. Orginially I just had a query with the Child Table but to get access to that one field (and to make it editable) I made this extra join.

I don't like this design eventhough it works..... Any suggestions on how to effectively implement this.

Also I don't understand how Access still knows what to do using the Parent Link And Child Link fields (Located in the Subform Control). How does Access know to create a new record in the Subtable and not in the Parent Table when both are present in my subform's record source now.

View 1 Replies View Related

Forms :: Refer To Combobox On Subform Within Navigation Form In Query Parameters

Jun 6, 2013

There is a command button on my form that calls a filtered query. I'm filtering the query based on a combo box within the form using

[Forms]![frmAssignDwgs]![Combo15]

It works beautifully until I put the form as a subform in the Navigation Form I'm using. When I execute it from within the Navigation form, it errors out looking for [Forms]![frmAssignDwgs]![Combo15].

Is there another syntax I can use so this will still work from within the Navigation Form? Or another way to approach this functionality?

frmNavigation is the main navigation form
frmAssignDwgToPkgs is the subform that holds Combo15

I found another thread (which I can't link to since I'm new) and tried various arrangements of the following to no avail.

[Forms]![frmNavigation]![NavigationSubform] .[Forms]![frmAssignDwgToPkgs]![Combo15]

View 3 Replies View Related

Combo Recordsource (dynamic)

Mar 2, 2005

Hello,

I have a combo box that i would like to dynamically change the recordsource (what values are available in the dropdown) based off of the criteria in another field. Basically, I want to switch which query the combo points to.

I am looking to do something like...

If field1 = nulll
combo recordsource = query1 (a list of values from table1)
Else
combo recordsource = quer2 (a list of values from table2)


I am looking to switch which query the combo is populated with, not limit the rows based on field1.

Any Ideas for this? Thanks!

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved