Thanks RuralGuy
That did the trick!
User Profile
Collapse
-
Show / Hide Form depending on data
Hi
I have a main form and want to put two subforms on a tabbed control (on the same tab)
Subform 1 will display data if it corresponds with the data on the main form. When this is true, subform 2 will be blank
Likewise, subform 2 will display data if it corresponds with the data on the main form and when this is true, subform1 will be blank.
How can I make the subforms visible only when... -
OK - I worked out what was wrong.
I created another combobox which worked and then compared the different properties.
The problem was a piece of code which I had attached to the OnClick property:
and must have interfered with the action of the OnChange piece of code.Code:Me.Requery
I would have added this code to refresh the data and then later added the OnChange code.Leave a comment:
-
Thanks for your replies, I'll try and give you the essential information.
The combobox is bound (control source) to the ProjectServiceL S field of the tblProjectEsitm ates table via a query. This table and query also has a field called SortOrder which I want automatically filled when making a selection in the combobox.
The combobox looks up a table called tblProjectServi ces to get the PCode (Project Code) field value....Leave a comment:
-
Me.cboProjService.Column(3) Not working correctly
I have a combobox on a subform with this code attached.
The subform is a continuous form. The Combobox updates the SortOrder field of the first record but subsequent records do not update when changed.Code:Private Sub cboProjService_Change() If Not IsNull(Me.cboProjService) Then Me.SortOrder.Value = Me.cboProjService.Column(3) Me.Refresh Me.Requery End If End Sub
... -
Mshmyob, your example is working and gives me something to build on. I really appreciate your help.
Many thanksLeave a comment:
-
Stewart, I have already tried that after posting the original piece of code. It did not help....Leave a comment:
-
Thanks again for your suggestions
This is what I have tried:
In a module
Attached to a buttonCode:Function TDXLOut(sql As String) CurrentDb.QueryDefs("MyQuery").sql = sql DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "MyQuery", "C:\ExcelTest\book1.xlsx", True End Function
...Code:Private Sub Command4_Click() Dim strSQL As String
Leave a comment:
-
Thanks Stewart
I am using Access 2007 if that make a difference to issues you mention above.
The references listed above are ticked plus I realise now I also have the Microsoft Excel 12 Object library ticked as the code above apparently needs this to work. (I have 6 references ticked).
I assume the list is the same regardless of which sub/module etc I have open for editing.
In other subs I have...Leave a comment:
-
Thanks Stewart
I tried that but still get the error. I also tried to tick the Microsoft DAO 3.6 Object Library reference as you suggested but I get a message saying it conflicts with existing Module, project or object Library.
Under references I have the following ticked:
Visual Basic for applications
Microsoft Acces 12 Object Library
OLE automation
Microsoft Office 12 Access database engine...Leave a comment:
-
OK
I have found some code that may do the job but I am getting a Runtime Error 3061 Too few parameters Expected 1 message.
This is the code:
...Code:Private Sub Command3_Click() 'This code was originally written by Dev Ashish 'It is not to be altered or distributed, 'except as part of an application. 'You are free to use it in any application, 'provided the copyright notice is
Leave a comment:
-
Linking Excel to Access Query
I have a query (with calculated fields) in Access (2007) and the data changes depending on the dates and staff person selected. I need to produce a series of graphs based on the data in this query and it seems to me that Excel is far easier to create graphs than Access.
When I use the Get External Data feature of Excel and the dialog box with the tables and queries appears, the query I need is not listed. Is this because the query... -
Thank you Linq ;0)> and NeoPa for your responses. I appreciate it.
CheersLeave a comment:
-
Date Function anomaly
I have some functions to calculate the working days in a given period. This includes a table that is queried to calculate the number of public holidays that don’t occur on a weekend.
If I test the function using the intermediate window, it works fine. However, when I pass the dates from the code attached to my form, the results are inaccurate.
You will notice my dates are in Australian format. Everything works... -
Thanks Delerna
This is what I have done.
I made a copy of the db and progressively deleted forms and queries until I only had all the table and one form and query left. It was still producing the error.
I had thought of trying your suggestion of creating a new db and importing the components into it but I found a backup copy that was behaving itself, so this won't be necessary.
As I think about...Leave a comment:
-
File not found error
The database I have been working on has now starting producing this error.
Each time I try to edit a vba code it produces this error. I can't even put in the comment symbol in to comment out lines of code.
What is even more puzzling is that it occurs regardless of any form I open the try to edit code.
I have been playing around with queries trying to achieve a certain result but this would have no bearing... -
Thanks Linq ;0)>
That did the trick!
Actually, I thought I had tried that at some stage but it did not work before. Obviously, I mistyped something!Leave a comment:
-
Syntax error (Missing Operator) in query expression
I am getting this error:
Syntax error (Missing Operator) in query expression '[Project] =ZYZ Project'
My code is:
intProjectEstim ate = DSum("LumpSum", "tblProjEstimat eLumpSum", "[Project] =" & Me.cboProject & "")
I have tried various combinations of double and single quotes without success.
Can anyone shed some light please?
Many... -
I feel so stupid - I had mixed up my field and variable names.
It should have been
MsgBox intInvNo (number is say 500)
intInvNo = intInvNo + 1
MsbBox intInvNo (number is 501)
InvNum is the field name!Leave a comment:
-
How to Increase a variable by one
I have an integer variable called intInvNum.
I want to increase the number by one.
This is my code that is not working with the brackets showing testing results.
MsgBox intInvNum (number is say 500)
intInvNum = intInvNum + 1
MsbBox intInvNum (number is 1)
I am sure this is simple but I can't get it to work for some reason
Many thanks
No activity results to display
Show More
Leave a comment: