ms-access-2007

Determine whether a Access checkbox is checked or not

蹲街弑〆低调 提交于 2019-11-29 09:08:54
Such a simple question, but I cannot find the answer (Google, MS help, SO): How can I check by VBA whether an unbound checkbox on an Access form is checked by the user or not? Can't find the right property. Thanks in advance! UPDATE: I used this code after the suggestions of @HansUp and @RC: Private Sub CmdTest_Click() MsgBox "Check1.Value = " & Me.Check1.Value MsgBox "Check2.Value = " & Me.Check2.Value End Sub Private Sub Form_Load() Me.Check1.Value = 25 Me.Check2.Value = 50 End Sub 2nd UPDATE: The code should be this (thanks to @David-W-Fenton): Private Sub CmdTest_Click() If Me.Check1 =

Access VBA - how to download XML file and enter its data into a recordset

这一生的挚爱 提交于 2019-11-29 08:49:42
I get an XML from website into a string strXML. Then I create an XML DOM document: Dim xmlDoc As MSXML2.DOMDocument Dim xmlElement As MSXML2.IXMLDOMElement Dim xmlNode As MSXML2.IXMLDOMElement Set xmlDoc = New MSXML2.DOMDocument xmlDoc.loadXML (strXML) DisplayNode xmlDoc.childNodes Now the DisplayNode is a recursive method which calls itself for every line in the XML data: Public Sub DisplayNode(ByRef Nodes As MSXML2.IXMLDOMNodeList) Dim xNode As MSXML2.IXMLDOMNode For Each xNode In Nodes If xNode.nodeType = NODE_TEXT Then Debug.Print xNode.parentNode.nodeName & " = " & xNode.nodeValue Else If

Access top n in group

做~自己de王妃 提交于 2019-11-29 08:02:00
I have a table where I need to get the top n highest amount items for each Category. Category Item InventoryCount ------- ----- ------------- Beverage milk 3 Beverage water 2 Beverage beer 9 Utensil fork 7 Utensil spoon 2 Utensil knife 1 Utensil spork 4 My desired output is the highest Inventory of the topmost 2 Categories. Category Item InventoryCount ------- ----- ------------- Beverage beer 9 Beverage milk 3 Utensil fork 7 Utensil spork 4 This should work for you. If it doesn't satisfy your requirements, post back what you need. Your original desire was to have 25, so you'd simply modify

WinHTTP VBA subsequent request cannot use the previous login credentials?

a 夏天 提交于 2019-11-29 05:11:05
I'm using WinHTTP in Access 2007 VBA to fetch some list of items requiring a cookie login credential account . First I login through https://www.example.com/login.php with this: Dim strCookie As String, strResponse As String, _ strUrl As String ' Dim xobj As Object ' Set xobj = New WinHttp.WinHttpRequest ' strUrl = "https://www.example.com/login.php" xobj.Open "POST", strUrl, False xobj.SetRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" xobj.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded" xobj.Send "username=johndoe2&password=mypassword" '

What ORM can I use for Access 2007 - 2010? I'm after WPF binding to the tables etc

给你一囗甜甜゛ 提交于 2019-11-29 04:40:09
I've a legacy database that all sites have, it describes specific content in a number of catagory/subcatagory/child item format. Until now, adding/editing the content is either manual work in the tables OR raw sql Windows Forms tool (I built when I started out in the job!). I would like Entity Framework style drag, drop, bind and run coding ability with WPF 4.5 and .net 4.5. I hesitate to use NHibernate as EF5 is very simple to get going with, I understand Nhibernate is more work (albeit a faster ORM). Are there alternatives that work well? I'm trying to avoid too much manual setup, if

How to populate the value of a Text Box based on the value in a Combo Box in MS Access 2007?

放肆的年华 提交于 2019-11-29 04:34:38
I have a combo box which is of a lookup type, i.e., I've selected the source to be a column from a table and am storing the selected value in another table. The table which I am looking up has another column and I need the value in this column to be displayed in a text box and each time I change the value in the combo box, I need the corresponding value to be displayed in the text box. How can I do this? What I have done so far is to write a Select query that selects the appropriate column based on the combo box's value. Is there a more decent way of doing this? Please help me! Make the source

Retrieve column values of the selected row of a multicolumn Access listbox

♀尐吖头ヾ 提交于 2019-11-29 03:43:09
How can I retrieve the value of specified column of the selected row in a multicolumn listbox? I populate the listbox by setting the RowSource property with a SQL string. BoundColumn set to value 1. I can retrieve the value of the bound column (of the selected row) by using ListBox.Value . But I also want the value of another column. Use listboxControl.Column(intColumn,intRow) . Both Column and Row are zero-based. Just a little addition. If you've only selected 1 row then the code below will select the value of a column (index of 4, but 5th column) for the selected row: me.lstIssues.Column(4)

Now() function with time trim

岁酱吖の 提交于 2019-11-29 03:03:05
So the function =Now() ....is there a way I can use this and only get the date, not the time? or is there just a function for this idea? There is a Date function . Dean Harding Dates in VBA are just floating point numbers, where the integer part represents the date and the fraction part represents the time. So in addition to using the Date function as tlayton says (to get the current date) you can also cast a date value to a integer to get the date-part from an arbitrary date: Int(myDateValue) . Nick DateValue(CStr(Now())) That's the best I've found. If you have the date as a string already

Text-search in properties Access objects

老子叫甜甜 提交于 2019-11-29 02:34:34
Is there a way in Access to search for a certain text in object properties and so on? Just not only in the VBA source code. I'm asking this because if I change for example the name of a field in a table I've to check a lot of object properties (Record Source, Control Source, Order By, ...). This can be done by trail-and-error or by checking all properties of each control of the forms, but that takes a lot of time. One option is the Find and Replace tool (nice tool!), but it's a bit of overkill for me. I don't need a text replace (only 'find') and it's 37 dollar for a tool I'll only use a few

A select query selecting a select statement

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 02:27:31
问题 I don't even know if I am doing this query the right way. There is a Sandwiches table that has some 7 fields and 2 of them are comboboxes ( Type and Bread ). So I made a query that combines all of the comboboxes values into one query, like this: SELECT TypesAndBreads.TBName, TypesAndBreads.Type FROM (SELECT [Sandwiches Types].[Sandwich Type] As TBName, "Sandwich Type" As Type FROM [Sandwiches Types] UNION ALL SELECT Breads.Bread As TBName, "Bread" As Type FROM Breads) AS TypesAndBreads; I get