Curious On Rich's Recordcount Advise
Nov 4, 2005
Rich helped Latex88 a little further down and the advise given was:
"=Count(*) in the control source of a textbox in the subform footer will do it, no vba is needed"
I tried this out out on a few of my subforms and it worked on all but one. The recordsource of the one that it does not work on is based on a query. When I changed the recordsource to a table then the recordcount works.
Curious as to why and is there a work around?
Thanks a head of time,
Shane
View Replies
ADVERTISEMENT
Jul 28, 2006
When you add a combo box to a form you get the wizard... all is dandy. After the wizard is completer you can see the things the wizard has done to get the requested features from the combo box.
For instance if you say I want the values from these fields from this table then you can see the SQL in the properties that have been generated by the wizard. Also if you choose the "Find a record on my form..." option then you can see the VBA code that the wizard creates.
There is one thing I can't figure out... When you choose to "Hide the key column" in the wizard what property or setting does the wizard alter to get this effect?
I could just use the wizard but it bugs me when I don't know how something is working.
View 1 Replies
View Related
Aug 13, 2005
Ms. Hartman,
You have may it very clear on a number of post, that I've read, that checking for required fields and duplicate fields, should be done in the forms BeforeUpdate event and last week, when you helped to try and achieve this on one of my forms, posted back and stated, "I never remove the close box or make forms modal unless they absolutely work."
Here's my question. If I disabled the forms max, min and close and then put my own Close cmdButton on the form and in this cmdButtons OnClick event I did my validations before I allowed the form to go to Close, wouldn't this at least be an OK way of doing it since I'm not allowing any of the forms "closing" events to fire? With BeforeUpdate I'm having to validate and if it doesn't pass, then stop the form from closing and cancel the forms events.
I'm only asking this cause I know your experience level is way above mine and of course I'm using my own close button, and the way you answered me made me think this was not a good way to do it, so I thought I would ask if it is a bad way of doing it and why. I just want to make sure that I'm not creating problems for myself.
Hope this makes sense,
Shane
View 1 Replies
View Related
Jul 14, 2006
I am trying to count how many records has a table with a special value (SolicitaçãoID.Text) but I keep getting error:
Compile Erro:
User-Defined not defined
And it goes to this line: Dim db As DAO.Database
This is the command:
Private Sub CmdAmostra_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim intResult As Integer
Dim strSQL As String
Set db = CurrentDb
SolicitaçãoID.SetFocus
strSQL = "SELECT COUNT (*) As RecordCount FROM Protocolo_O where SolicitaçãoID=" & SolicitaçãoID.Text
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
intResult = rs("RecordCount")
MsgBox intResult
Amostras.SetFocus
Amostras.Text = intResult
rs.Close
db.Close
End Sub
Well i have no clue what that error means and why.
Thanks for the Help
Art
View 9 Replies
View Related
Oct 6, 2006
Thanks for looking at my post. What I have done is this, i have built a custom search form for my access database. What i need is a textbox that shows how many records will show up if the user clicks generate form.. I want this textbox to update every time the person changes his search criteria. For example
the person wants to search by address, by typing in
Gold into the address textbox the recordcount textbox would show the user if he were to press generate form he would get
1200 records
now if he changes the address to
GoldStone -- the recordcount textbox would then update to show only
14 records would be shown if he/she generated the form...
Here is my current code
***********
Set db = CurrentDb
Set qdf = db.QueryDefs("MainDB_Search")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rs = qdf.OpenRecordset(dbOpenDynaset)
rsCount = rs.RecordCount
MsgBox (rsCount)
txtGenerateReport.Value = rsCount
************
Now the problem with this code is that it works the first time the user types in search criteria, however when he/she tries to change it from Gold to Goldstone -- nothing happens, it runs the code above and returns 1200 records instead of the correct 14...
Please help :)
Thanks
Jason
View 4 Replies
View Related
Aug 25, 2006
I have several bound subforms whose recordsources are based on querydefs...
I use the following code in the OnCurrent event of the main form to count the number of records on a subform,
Me.mysubformname.Form.RecordsetClone.RecordCount
but for some reason, one particular subform won't give me the correct count... the only difference I can see between the problem subform and the others is that it is populated by a union query... any reason why that would be causing the problem? Any other thoughts?
Thanks in advance,
Scott
View 3 Replies
View Related
Feb 28, 2005
The company I work for remains on the 2.6 version of the various MDAC components. Unfortunately, upgrading is not an option that I can control. So....
When I open a recordset which DOES contain records, I often return a RecordCount of -1. EOF is false, so that is working, and I am able to use that to get around part of my problem. Where I need the count after iterating through the recordset, I am able to use an iCounter variable to get that. I have tried using MoveLast, MoveFirst, etc. before calling for RecordCount, but that does not help.
In many instances having the count BEFORE going through the recordset would be very helpful. Has anyone else ever encountered this problem? Anyone devise a workaround?
Thanks in advance for any help!
John
View 3 Replies
View Related
Oct 14, 2005
I have created a switchboard and some additional forms. I would like the frontend of the database to display my forms in a maximized view when the users opens them. Can anyone advise me how to do this?
For some odd reason when I make changes to the forms (example) resizing them my clicking and dragging the edges, the changes will not save. Can anyone advise me what I may be doing incorrectly? :confused:
View 3 Replies
View Related
Oct 27, 2005
I am using Access 2000 and have the following issue I need assistance with please.
I initially had no primary key set on the table and the form and all the data from the tables showed fine in my form. However, I wanted a primary key to prevent a user from accidentally typing a duplicate Repair Order number in the form.
I went back into the table and set a primary key as our company’s Repair Order number. Since this number should never be duplicated I wanted this as the primary key. I had a ton of issues and kept receiving messages that indicated I had duplicates in the table. After running a query through the wizard to find the duplicates in the Repair Order column, which the query could locate, any, I finally exported the data in the table into a spreadsheet. Then I created a new table and set the primary key to Repair Order Number and set the index in the properties to “yes, no duplicates”.
However now when I go over to my form, the field for the Repair Order number, Model number, Serial number and Phone number now show this error message in the field #Name?, and will not allow a user to type any text or numbers into these four fields. The other fields do show the data from the table. I went through help for information on #Name? and verified that I do have Msowcf.dll and it is not missing from my computer.
All the other data was pulled from the table into the form except for these four fields. I did verify that there are no duplicates in the Repair Order column of the table but the Model and Serial numbers can have duplicates as well as the phone number.
If I change the index properties under the primary key of Repair Order Number and tell it to allow duplicates these issues go away but it seems I can't prevent duplicates from occuring in that particular field then.
Another note. I do have fields that work from a “Date of Service” that calculate out adding 10 months to the Date of Service as a contact date and another field that calculates out 12 months as an annual service date. Those seem not to be affected and the formulas are working fine in those fields on the forms.
I am not very familiar with Access and I am still in the learning stages. Can someone give me some insight on what I may have missed or need to correct? Please be specific. Any assistance would be greatly appreciated. This one has had me stumped for several days.
View 3 Replies
View Related
May 21, 2013
For small tables (<10,000 rows), which technique is faster, more efficient ?
View 11 Replies
View Related
Jun 19, 2005
The question is whether or not to normalize the fields "Place of Birth/Place of Death" in my 100'000 records famous people data base. So far, 15'000 different birth places are deployed. Only 3'000 of them are used more then once, that is to say from 2 to a maximum of 1000 times (New York City). 12'000 birth places are therefor used only once up to now. So, a table of 15'000 places would need a 3-digit (all characters used) or even a 5-digit (numbers only used) identification. In the latter case the ident would often be longer than the returned value (Wien, Oslo, Rom, it's in german, you know). Furthermore, instead of just entering a birth place like "Novodny Chomarowsky" I had to search the table of places whether or not the entry has been used yet. Please supply strong pro-normalization-arguments.
View 14 Replies
View Related
Dec 8, 2006
Hi,
I have the following forms setup:
frm_Main (Switchboard)
frm_Customers (Form)
frm_SalesDetailsSub (SubForm on frmCustomers showing basic details of items they have bought)
On frm_Main I can search for Customers by Surname using the following code behind a search button on the form:
On Error GoTo Err_Handler
Dim stQry
Dim stDocName As String
stQry = SearchSurname() 'Query containing tblCustomers
stDocName = "frm_Customers"
DoCmd.OpenForm stDocName, acNormal, stQry, "((([tbl_Customers].[Customer_LName])like[Customer Surname?]& ""*""))"
Err_Handler:
If Err.Number = 2501 Then
Resume Next
Else
Resume Next
End If
This works fine, however I also want to search by items on the subform frm_SalesDetailsSub by using another button on frm_Main. I have tried code like the one shown below.
On Error GoTo Err_Handler
Dim stQry
Dim stDocName As String
stQry = SearchSaleItem() 'Query containing tblCustomers and tblSales Items linked via ID
stDocName = "frm_Customers"
DoCmd.OpenForm stDocName, acNormal, stQry, "((([tbl_Sales_Details].[Sales_Details])like [Item Description?]& ""*""))"
Err_Handler:
If Err.Number = 2501 Then
Resume Next
Else
Resume Next
End If
I have tried lots of different variations of code, but can't seem to crack it.
Any advice is welcome.
Daz.....
View 8 Replies
View Related
Feb 7, 2008
Hi, I'd like to ask for help about Access, ASP - all this is new for me...
I'd like to make an Access based website for searching, comparing and adding some electrical appliances. These appliances are supposed to have a lable name, type, serial number and they also have some options. (Just like cars: volvo, s80, color red, airco).
My question is about the structure of the database: is it better to store for example the "colors" in a separate (related) table in Access or to have one table for everything and use the lookup option with dropdown menu? Can I connect such a dropdown list from the lookup in database to the website using ASP? And if some options have options themselves (like manual airco/automatical airco), what is the best structure for it?
The final product must be a site where new models can be added and available appliances can be searched and compared.
Thank you for your help,
Alex
View 13 Replies
View Related
May 12, 2005
i have a query that provides data like so:
IDNumber - Units - WeekNo
55643 - 180 - 1
55643 - (Null) - 2
55643 - (Null) - 3
55643 - 135 - 4
55643 - (Null) - 5
55643 - 0 - 6
55643 - (Null) - 7
is there a way of adding something to the SQL to make it fill in the Null values to the most previous value of Units? in other words, the top 2 Null's would become 180, the next one down would become 135 and the bottom one would become 0.
since data is not entered weekly, these Null's are inherently there for certain weeks and i am hoping that with the Nulls replaced, i can produce a bar chart from this query for a report. if the Null's remain, i am getting 'gaps' in my chart which look like zero's.
many thanks.
View 2 Replies
View Related
Aug 17, 2006
Hi!
I've written a querry - and the results that come back dont look right. Some rows have data in and others dont.
Has anyone seen something similar?
Does this mean that the data are probably incorrect?
Any advise?
A.
View 1 Replies
View Related
May 23, 2005
I have a .csv (MS Excel) file I need to import, but one of the fields contains rich text format text.
Is there anyway to clean this up before or after it is imported?
Thanks,
T.J.
View 2 Replies
View Related
Apr 9, 2007
Hi guys, I was looking for a way to trap err.number 3314 (when required field is null) before Jet generates its warning. I came across an old post from Rich (below), but I couldn't make it work as yet. In the calling form, under the Form_Error event I wrote the following:
Dim f As Form
Set f = Me
Call fnValidateForm(f)
Could anyone please tell me where my error lays here? I have several forms which have several text and/or combo boxes bound to required fields and I would want to have a generic code, like the one here to trap errors before Jet shows it's Error Message.
Thanks in advance
Regards
Jaime Premy - Belém-Brasil
******************Rich's Function********************
Public Function fnValidateForm(frmA As Form) As Boolean
Dim ctl As Control
Dim Msg, Style, Title, Response, MyString
fnValidateForm = True
For Each ctl In frmA.Controls
'value in the control is required
If InStr(1, ctl.Tag, "Required") > 0 Then
' no value entered or value is null
' or zero for numeric fields
If (IsNull(ctl.Value)) Or (Len(ctl.Value) = 0) Then
ctl.SetFocus
MsgBox "You have not entered all the required fields return to the record and correct this! The record will not be saved if you do not! "
fnValidateForm = False
Exit For
End If
If InStr(1, ctl.Tag, "NumberRequired") > 0 Then
If ctl.Value = 0 Then
ctl.SetFocus
MsgBox "You have not entered all the required fields return to the record and correct this! The record will not be saved if you do not! "
fnValidateForm = False
Exit For
End If
End If
End If
Next
End Function
View 5 Replies
View Related
Mar 7, 2005
To ensure that each date field (3) on my form is not entered earlier than the previous one shown, I attempted to setup a before update event based upon what I've found in searching on date verification or date validation in the forum.
Note - I defined BadDate in the OptionExplicit...
Private Sub Date2_BeforeUpdate(Cancel As Integer)
If Me!Date2 < Me!Date1 Then
BadDate = MsgBox("Date2 is earlier than Date1, please correct!", vbOKOnly + vbInformation, "Wrong date selected!")
Date2.SetFocus
End If
End Sub
I am using one calendar control to load all 3 dates on the form (via a variable). I want to also check to ensure that Date #3 is later than Date #2 but... the first check isn't working at all. I suspect the calendar control is the culprit.
Thoughts?
MikeG
View 2 Replies
View Related
Oct 4, 2006
Hi,
I have created forms in MS Access.. Now i want to attach Rich Text Format with each of the Text Box or Text Area... How can i do that...
I was trying to search for a plugin which would get attached with MS Access and then while creating the forms it would get attached with the Text Box and Text Areas..
Kindly please help me in getting a solution to this problem..
Thanking you,
with regards,
Kapil Sharma
View 7 Replies
View Related
Aug 12, 2011
how to make a line break in a rich textbox in access 2007? Chr(13) & Chr(10) worked until I changed the textbox to rich, which is necessary because certain words in the textbox need to be bold.
View 2 Replies
View Related
Oct 16, 2006
Hi..
I am using RTF2 ActiveX Control which enables me to include the Rict Text Controls in my Access Form.
I want to generate a doc document out of the information which i type in the RTF2 Area on the Access Form. And whatever Rich Text Format information i have written there (for eg in Bold, Italics, Indentation, Tables created, Bullets n Numbering etc), is retained as it is on the Doc document which i am generating with the help of bookmarks.
Please help in how do i do that 'coz i am not able to do it using the Rich Text Format...
Thanking you,
with regards,
Kapil Sharma
View 3 Replies
View Related
Feb 25, 2005
Can anyone help?!
We are trying to export some reports into a Rich Text format using Access on Office 2003 on a Win XP op system. When doing this on Win 98 the Rich text document was slightly out of line but not too bad. Now we are doing it on XP it is completely out of line and unusable. Does anyone have any suggestions please?
Regards
Richard
View 3 Replies
View Related
May 6, 2014
When I changed the memo field from plain text to Rich Text, I got the below divs and slashes. Is there any way to get rid of them?
<div>GC in process - EB1.</div>
<div>Â </div>
I had only "GC in process - EB1" in plain text.
View 1 Replies
View Related
Oct 21, 2014
I'm trying to output some logging to a form with a Rich text textbox
This is what the form is displaying:
14:16:32: check OK: 500<10000andS235='s460'>
14:16:32: check OK: 500<10000andS235='s355'>
14:16:32: check failed:too short 500<1000231231 >
14:16:32: Ready ...
There is some coloring in the text but I'm not display that here (copy/paste of the textbox)
This is the HTML behind it (? txtbox in imm.window):
14:16:32:Â <font color=black>check OK: 500<10000andS235='s460'</font><br />14:16:32:Â <font color=black>check OK: 500<10000andS235='s355'</font><br />14:16:32:Â <font color=red><strong>check failed:too short 500<1000231231 </strong></font><br />14:16:32:Â <font color=green><strong>Ready ... </strong></font><br />
The problem is in the red > that are added to each line. I have no clue where they are coming from, in fact: they are NOT in the HTML.When I display this piece of HTML in IE I don't get the red > behind each line.I have tried to use <p> of <div> instead of <br/> but that makes no difference
Code:
Forms!frm_Calculationlog.txtmsg = Forms!frm_Calculationlog.txtmsg & "<div>" & _
Format(Now(), "hh:nn:ss") & ":Â " & _
IIf(strColor <> "", "<font color=" & strColor & ">", "") & IIf(booBold, "<strong>", "") & strMessage & _
IIf(booBold, "</strong>", "") & IIf(strColor <> "", "</font></div>", "")
I can assure you that the > is NOT in the strMessage ... f.e. this is the ouput of strMessage on the first line: 500 <10000 and 'S235' ='s460'
strColor is a string in which I can set a color ("red", "blue")
booBold is a boolean with which I can set text to bold
View 4 Replies
View Related
Nov 21, 2013
I have a Memo field in my table. I have changed the Text Format property to Rich Text. I can now change the formats etc of the values in the field.
However, I now want to see the Markup HTML tags in the table fields i.e. <b>test</b> in order for me to make changes manually as well.
View 5 Replies
View Related
Feb 13, 2008
Hi,
I've just installed Stephen Lebans Rich Text Control as I have a a couple of memo fields on a form on a 2003 database where the user needs to be able to bold parts of the memo. I've installed it fine, and put the text control onto a form and it doesn't seem to do what i need (i.e. the Bold button isn't even enabled on the toolbar). I've downloaded the sample database that he has on the site and this works fine suggesting ive installed it correctly and i am going through the properties of the control with a fine tooth comb but havent found anything different yet to what i am doing on my trial form.
Any ideas what I've missed?
View 1 Replies
View Related