I was not sure exactly how to word the title so that it made sense, but I have strDocName assigned a report name and would like to use the value of the string on the left hand side of an evaluation. In the example below (which changes the caption of a report depending on the week) where stDocName appears in the "Reports!stDocName.Caption = ", I wish to actually use the value stored in the string. Does that make sense? This is what I have:
Code:stDocName = "rptTopScores" DoCmd.OpenReport stDocName, acViewDesign, , , acHiddenReports!stDocName.Caption = Forms!frmDoStuff!LeagueName & " - Match " & Forms!frmDoStuff!txtWeekNum & " - Media Report"DoCmd.Close acReport, stDocName, acSaveYes DoCmd.OpenReport stDocName, acPreview
This is what I want it to evaluate as:
Code:stDocName = "rptTopScores" DoCmd.OpenReport stDocName, acViewDesign, , , acHiddenReports!rptTopScores.Caption = Forms!frmDoStuff!LeagueName & " - Match " & Forms!frmDoStuff!txtWeekNum & " - Media Report"DoCmd.Close acReport, stDocName, acSaveYes DoCmd.OpenReport stDocName, acPreview
And yes I know I could just use the second code segment, but then I wouldn't be able to use the code snippet without remembering to edit it. I've spent a couple hours trying to find the correct method to no avail. Any assistance out there?
Guys, any idea how to evaluate the command line options used when an Access application is started from a command line. For example I use the following command line: C:..MyDatabase.mdb /parameters:110001110 Then, in VB, I evaluate the string "110001110" and do the further job. Is there any property or function to return the command line option string? Thanks
Hi, I try to execute an update command i.e.: UPDATE Results set Data = 'Heiner's key' where ValidationNumber = 1 and TestNumber = 2 and Line = 'E1'. Access does not let me do this because the “'” in Heiner's terminates the update string prematurely. Does anyone have a suggestion how to do this? Thank you.
I am trying to create an Access 2003 database that contains several types of demographic information about the employees in my organization (40+ employees). I have created a database framework, but I feel as if I am not doing things as efficiently as I could be. I was wondering if anybody could look at my database and let me know if they notice anything in my tables or fields that could be better/fixed. I would appreciate it so much.
I have attached the database in a .zip file to this post (it wouldn't allow me to attach it as an .mdb file, so I zipped it).
Thanks so much. Feel free to reply via this thread or email me with any comments/help you can give me. Thanks so much again!
Hello I keep getting the error after I copied a form and saved under a different Name ++++++++++++++++++++ A problem occured while Microsoft Access was communicating with OLE Server or ActiveX control.
There may have been an error evaluating the function , event or Macro
+++++++++++++++++++++++++ Strangely, I keep getting this error when loading and clicking on a control in the ORIGINAL form while the copy seems to work without errors.
I have deleted some tex box controls from the first form and added a few new ones in the copy.
I have tried a copy of the database by deleting the New form, but still get the same error.
I have run DEBUG on both form codes and everything seems fine.
I have checked the refrences and find none missing.
Is there any way to resolve this issue. Or am I doing something fundamentally wrong by copying and modifying the form ?
i have a query that returns a dataset that looks like this:
Account Status 123 Paused 123 Paused 123 Not Paused
I want to evaluate these results and in a second query, for the account 123 return the value "Not Paused" if there is at least one status set to "Not Paused".
I am having problems getting Access to evaluate whether a textbox is empty using VBA behind my form. I'm currently using Access 2000 on a Windows98 machine, but I also tested this in Access 2003 on an XP machine and got identical results.
The way I’d like the code to operate is if the “Product1” field is empty, the value taken from another form would be pasted there, and if it isn’t empty, go to the “Product2” field and if that field is empty, paste it there, otherwise go to the “Product3” field, etc.
I have tried using If IsNull(“Product1”) Then… but Access seems to think that the unbound textbox with no default value isn’t empty.
I tried using If ("Product1" <> "*") Then… but Access again seems to think that there is something in that unbound/no-default value textbox.
ElseIf ("Product2" <> "*") Then DoCmd.GoToControl "Product2" DoCmd.RunCommand acCmdPaste …
End If
I admit that my VBA skills are limited, but after having scoured these forums as well as Access help and examining the logic of my code, I am completely stumped. Any suggestions you can offer would be greatly appreciated!
Code: 'Pacer frame set to proper background If Me.FrmPacer.Value = 1 Then Me.LblPacer.BackColor = vbGreen ElseIf Me.FrmPacer.Value = 2 Then Me.LblPacer.BackColor = vbYellow ElseIf Me.FrmPacer.Value = 3 Then Me.LblPacer.BackColor = vbRed
[code]...
I have multiple frames on one subform that when selected sets a unassociated labels back color. Then when cancelled by undo code the back color stays on the color that it was changed to on afterupdate event from the frame with option controls. I would like to loop thru but could not come up with the proper method if it is even possible.the above code works after refreshed, but just wondering if there is a shorter or more efficient method.
I'm struggling with a query to evaluate current and prior record data. I have a query producing 5000 records. I need to group records by Case ID and compare current date record to previous date record to determine if a team and worker name has changed during the year. I need to count how many times a cases is transferred to and out of a particular team from the beggining of the year. i.e., On 1/1/2014-Team1 has an inventory of 500 cases.
During the month 25 cases are transferred into Team1 and 15 cases are transferred out of Team1. So on 2/1/2014 Team1 begins with an inventory of 510 cases. Throughout the year cases come and go from and to Team1 each month so need to figure out how to create a query to count each change. See attachment displaying how the data is listed and how I invision it to work with the In/out column counts.
Specifically, at the begginig of the year (1/1/14) for case ID 1003 you can see it belongs to Mary in Team1 for January and February. Then in March the case is transferred out and went to Joe in Team 3. So for Mary a "-1" is recorded as a negative count for that Case ID. If later in the year the case is transferred back to Mary a "+1" would be recorded. Respectively evaluated for each of the 5000 records to get a total count for each of the teams by Case ID throughout the year.
I've started with DLookup, tried comparing current month to previous month using DMax. It works as long as I only select one case ID used in a separate query but if I use the whole subset (5000 records) it fails. I can't figure out how to group each set of case IDs and then apply the query.
I was looking for some help. I am trying to setup a table with a field for web address. People are entering www.website.com etc however I need them to make sure it starts with http:// Is their any way I can put validation on the field to make sure that this is entered? Or maybe I could use an input mask?
I am rewriting an old Access 2003 database in Access 2010. When creating new command buttons, the current theme gives them a default appearance. I need to apply this appearance to old command buttons. I know there is a way to select the default button and apply its properties to others quickly. I have done it before but didn't write the process down .
The following SQL query is returning no records when I know for a fact there are some there! Can anyone please hlp me?!
Dim strSQL As String strSQL = "SELECT * FROM tblHirer WHERE HirerSurname= 'Forms!frmFinanceProposal!Child845!Text430'" rsFindDuplicates.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic rsFindDuplicates.RecordCount
Also, I was wondering how I would put as 2nd filter on the recordset to equal a particular date?
SELECT Institutions.*, Institutions.merge, Institutions.Inst_type FROM Institutions WHERE (((Institutions.merge)=True) AND ((Institutions.Inst_type)=[forms]![merge_inst_type]![Inst_type]));
and I had a command button which process
MergeAllWord ("select * from merge_query_true")
but I am getting an error like this "make sure the sql is correct , sql was select * from merge_query_true
select * from merge_query_true ---- is this code ok?
If I had cut the part "AND ((Institutions.Inst_type)=[forms]![merge_inst_type]![Inst_type])); from the sql it works fine....
I have a fax number field iwhich has a mask. +(000)-00-000-000 in a table of many records. The problem is that every record has a number in the first part of country code +(001)which must have come there by mistakes, few records have complete and true fax numbers.
I need a query that can Update this Fax_Number field where the length of the string is less than 7 digits. Some thing like UPDATE Contacts SET Contacts.Fax_Number = "" WHERE ((Len("Fax_Number")>"6"));
The first section is the Category, the second is the Product, the third is the SubProduct and the fourth is the keyword.
What is the best way to split each of these words into its own variable? I think I can do the first and end one but not the Car Import and Car Import one.
I'm working on a software that was developed by someone who left the company. The problem is that the software works for all locations execpt one that is in austria, after debuging I found out that there is a statement in the code that uses boolean true or false, the only way it worked is when I put an if statement with false or true as string, ex: if doc = "true" then buttom line has anyone faced this problem, I searched microsoft website and they said that some vb engines don't convert boolean to string. Please Please if someone has a clue try to help. Thanks.
Hey everyone, I need some help with formatting a string for use with the DoCmd.RunSQL() method. I can't figure out how the hell VB deals with escape characters for the purpse of variables inside strings. I have this line right now.
strSQL = "INSERT INTO OS (OS) VALUES(" + OS.Value + ")"
This is supposed to insert one row into the "OS" Table, in the "OS" field. In my form there is a textbox called "OS" and I'm trying to insert that value into the DB table.
Two things. 1) Yes, I know, I have a lot of things named "OS" 2) Yes, I know I don't need to use a string here, but I'm just presenting this is an abbreviated example, in my full program I do in fact need a string.