Can anyone direct me no how to get rid of the text "#Error" showing up on my form field when there's no value. This is the txtbox on my main form and it's looking up its value from another txtbox on my subform.
The main form textbox produces #error when there is no record on the txtbox on the subform. It's controlsource is: =subfrmWorkDone.Form!txtGrandTotalTime
The controlsource on the subform txtbox (where the value is wants to be gotten from is): =(Format(Sum([Timestop]-[timestart]),"h") & " Hours" & " " & Format(Sum([Timestop]-[timestart]),"n") & " Mins") and it works perfectly and simply doesn't show anything when there is no value.
How can i get rid of this #Error. It's not really an error cos it produces the value from the subfrm correctly when there's a value on the sufrm txt, when there's no value, i get the #error on the mainform (but a blank shows on the subfrm, which is what i want).
The #error will confuse any user to think my form has a problem when it really does not.
I have tried wrapping it in a ISNULL IIf and this =IIf(subfrmWorkDone.Form!txtGrandTotalTime=Null," ",subfrmWorkDone.Form!txtGrandTotalTime) but no luck. Any more ideas?
In my application I have continuous form with unbound textbox. In OnOpen form event I change ControlSource property of textbox to one of the fields (e.g. "Kol921") in forms recordset. In form footer I have another unbound texbox where I defined ControlSource property as "=Sum([Kol921])".
Values in fields shows correctly, but in "sum" textbox I get Error.
When I get through code in debugging mode (with F8 key), value in "sum" texbox shows correctly, but when I open form normally I get an Error in that textbox.
Here is part of code: Me.Controls("mat1").ControlSource = "Kol921" Me.Controls("mat1").Visible = True Me.Controls("matSum1").ControlSource = "=Sum([Kol921])" Me.Controls("matSum1").Visible = True
In my database main form with subform. subform have query as recordsource.total of one of field in subform shown on main form. all is ok and show total correctly but when subform have no records then total field on main form shows #error. How to convert this value either into null string or zero(0).
I have a form that has several fields that a user will enter data. When finished, the data is inserted into a table. Works great. What I want to do now is look at one of the fields entered and if it is equal to a certain value, I want to disable one of the other text boxes (fields) on the form AND pop a screen that will allow the user to enter a list of names that will update a different table.
So, if user inputs a directory name GENERIC, the txtScriptName box needs to be disabled/greyed-out and I need a form to pop so the user can put in a list of script names. If any other directory name is entered, the txtScriptName box needs to remain editable. (For directories equal to GENERIC, there will be multiple script names instead of just one)
I've been successful at getting the form to pop if GENERIC is entered but can't figure out how to grey-out the txtScriptName field. I tried using Me.txtScriptName Locked in the Before Update of the preceding field but it didn't work - could still update the txtScriptName field.
I'm trying to make a report query work but with no succes so far. Can anyone please help me? I've got a multiselect listbox and a txtbox (txtCursisten) where the results from the multiselect listbox appear. I want to get the results out of a table (tblAbsentie) where I can set a start and end date AND use the people selected in the txtBox. So far I've got a NOT working query, a report based on the query and a button on my form.
The VB code behind the "show report" button is this:
Private Sub cmdAbsentiePerCursistPerPeriode_Click()
On Error GoTo Err_cmdAbsentiePerCursistPerPeriode_Click
Dim db As Database Dim Q As QueryDef Dim sql As String
If IsNull("Me.txtCursisten") Or Me.txtCursisten = "" Then Exit Sub Else
Set db = currentdb() Set Q = db.QueryDefs("qryAbsentiePerCursistPerPeriode") Q.sql = "SELECT tblCursist.Naam, tblAbsentie.Datum, tblAbsentie.Lesuur, tblAbsentie.AantalLesuren, tblAbsentie.Deelkwalificatie, tblAbsentie.Docent, tblAbsentie.Gemotiveerd, tblAbsentie.Reden, tblAbsentie.Status, qryCountLesuren.SumOfAantalLesuren" & _ "FROM (tblCursist INNER JOIN qryCountLesuren ON tblCursist.OVnr=qryCountLesuren.OVnr) INNER JOIN tblAbsentie ON tblCursist.OVnr=tblAbsentie.OVnr" & _ "WHERE (((tblAbsentie.Datum) Between [Voer begindatum in] And [Voer einddatum in]) AND ((tblAbsentie.OVnr) In ("Me!txtCursisten"))); " Q.Close
DoCmd.OpenReport "rptAbsentiePerCursistPerPeriode", acPreview End If
On Error GoTo 0 Exit Sub
Exit_cmdAbsentiePerCursistPerPeriode_Click: Exit Sub
Err_cmdAbsentiePerCursistPerPeriode_Click: MsgBox "Selecteer klas en cursist(en)." Resume Exit_cmdAbsentiePerCursistPerPeriode_Click
End Sub
I get a syntax error when pressing the button. Please help... SeBasTiaan
I have a form that contains a textbox and a listbox. The listboxs rowsource is tblSPNZ. The table has 2 fields 1 is and autonumber and the other is where I want the results to go.
How do I make a command button populate the table? Avoiding putting any results into the autonumber field?
I have a form, on the form a textbox. Through the expression builder I have assigned one value to the control source of that textbox from a query. The query holds three values, all three of which I would like to use in a separate textbox. When I open the form the textbox just displays #Name. I'm guessing since nothing is happening because the query isn't run by command yet. I've used code like this:
Private Sub AppointmentID_Click() Forms![ClientsMain]![TechViewSummarySubForm].Form.Requery Forms![ClientsMain]![TechViewSummarySubForm].Form.Refresh End Sub
to get a query to open, run etc. But that one is located in a subform which has the query as a control source. How does that work in the case I have now? Can I use the DoCmd function to run the query and get a value from it for the specific textbox? Or can't I use a (segment of a) query as the controlsource of a textbox at all?
I'm asking this since now I calculate and store certain totals by use of a textbox with =Sum() as control source in the footer of a form, which values I then assign to some fields in a table.
But I would also like to learn the right way, using queries, maybe for a later version of my DB when my skills have improved. I've been struggling with this now for a bit, but without succes. So that's why I wonder if I can assign a query or more specific one value of a couple of values in a query to a textbox in a form which has a totally different control source itself.
Hi all, I have a select query that pulls in two date values from a textbox on a form.
SELECT DISTINCT Table01.SRV_NAME, Table01.IMP_CUTOFF_DT FROM Table02 INNER JOIN Table01 ON Table02.Servicer = Table01.SRV_NAME WHERE (((Table01.IMP_CUTOFF_DT)=[forms]![frmreport].[txtsqldate].[value])) ORDER BY Table01.SRV_NAME;
However when I run it I get the following error message:"This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may...." but when I copy and paste the value of that txbox from the form into the query it works fine.
Can anyone see where the problem lies? I can't work it out.
Here's a bit of a pickle I've been trying to wrap my noodle around.
Anyone have an idea what route to pursue (unbound form, or afterupdate, etc?) to force a validation rule on the number of characters in a text box based on the value of combobox in the same form.
Example: If cboBox1 = 840, then len(txtBox2) = 6 But if cboBox1 = 820, then len(txtBox2) = 3 And so forth?
I have placed a txtbox on my form and via a cmdbutton a can copy data to another text box. Is there a way I can replace data? Will appreciate any help.
I have a form that has a combobox and a field text. If i select any value in combobox i want to update the txtBox but not with the ID of the selection. I need to get the description of the combobox selection which is essentially the Column 2.
It's an unusual request, I know, but it's necessary for my purpose.
I have a form, frmMain that I use to update a number of tables. On it is a number of combo boxs, comProduct, comBrand, comSize, comPrice and comQuantity. comProduct opens a new form, frmNew if the users input is not already in the table. On frmNew there are again combo boxes comProduct, comBrand and comSize. This form adds the record to the table.
So, if I input a new value - not already in the database - for product in the comProduct combo box, the form frmNew appears and I can proceed to define the product, brand and size of the new record. The form then closes and reopens frmMain and tabs across to comQuantity (skipping the fields I've already defined in frmNew).
Now if you can wrap your head around that, here is the problem: Because I've already entered the values for product, brand and size in frmNew, I want them to automatically appear in the appropriate combo boxs on the frmMain form. I've been using the following code (executed from frmNew, so Me = frmNew):
It works, but I've since discovered it creates a new record in the table so I end up with two duplicate records (one when I submit frmNew and another when the values are automatically input into frmMain.)
Now, my question: How can I display these values in frmMain without having them create the second record? I was thinking of using a SELECT query somehow, but I don't know where to begin. I also considered using labels instead of comb boxes, but I'll need to be able to edit them if the record already exists.
I have a table tblDateGroups, with two field, [Group] (like This Week, Next Week, Last Month, etc) and [Code] that holds the code for criteria for each group in a query. I know the code is fine (like next week = Between Date()-Weekday(Date())+8 and Date()-Weekday(Date())+14 ) because I tested before putting in the table.
On my form I have a combo box that list all the [Group] and i hidden textbox that looks up the code based on the cbx after update...all that is good.
However, when i try to requery the report the criteria is not working. I am simply using the date criteria to read the hidden text box with the code string.
the error code is "This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables."
The 3rd LB value chooses a field. The Fieldname Table has field "Field Type"
I want to change the Text box next to the List box to this entry in the Db.
Ie. If I choose a field in the LB, say "Done?", then to update that field it needs to offer me a "yes/no" field type Therefore it changes the TextBox to a Checkbox (or combo with Yes and No as options)
I would like to write an expression (i presume) to auto fill a text box based on the selection made from a combobox...can anyone help or point me to a tutorial that deals with this??
I have 2 cascading combo boxes which control what appears in my subform (AuditYear,Company).
Once I select both, sometimes the subform info shows up and a while later I try again, and it doesn't. Then I try some other AuditYear + Company, then THAT shows up...then I try again, it doesn't.
I just added my third record to my new form and it is gone. However, it shows up in the table. I think it is because there are two record selector bars on my screen. I have two subforms and each one has a record selector bar on them and then there is an additional bar at the bottom that is like for my main form, which is blank. (I don't use the main form. I just have subforms over it.) I think the second record bar is goofing things up? And where is my record I just added. It only shows as two records total. Should I get rid of the subforms record selector bars?
I am getting 2 problems what I am trying to do is depending on the user logging in I want to open form (Aform) on specific record for that person ID. However where Y=1 I am getting a popup asking for AForm ID and where Y=2 I am getting run time error 3075 Syntax error (missing operator) in query expression.
Code: Private Sub Command6_Click() If IsNull(txtUsername) Then MsgBox "Invalid username" Exit Sub End If If IsNull(txtPassword) Then MsgBox "Invalid password"
On one of my queries, the dataset is shown with a * as the last record. There's nothing in it apart from blank data but it is appearing on my forms. All my other queries do not seem to have this.
I have a textbox on a Subform which is updated when a record is double clicked in another Subform. This works fine until i move the mouse over the updated subform. Then the updated entry is replaced with #Deleted. The data is still in the table that gives the subform its value. Also another form running has the same subform and it and the updated value is shown perfectly in this one. Anyone know why this may be happening?
I have a form with a subform which has a listbox on it which lists all the letters sent home to a student. However despite the subform being linked by admission Number the list box is showing all records and not just the ones associated with the student.
I know this is going to be really obvious but please can someone tell me what is wrong?
Hello, How would I go about in making a command button bring up a report to show a result of items for the end of the month? For example, when a user clicks on this button it will bring up a report showing all the items that are out of date for the end of the month. I am having problems with the query as for months have different lengths e.g. 28/29/30/31 days. How would I make a query show the end result for each month correct as February if going to be different each time i.e. when it is a leap year. I have got far but having trouble with this part. Hope you can help.