Microsoft Access

221K

Solutions

52K

Contributors

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

Share tech news, updates, or what's on your mind.

Sign up to Post

How can I capture an image (jpg, png, gif - some common image type) of the entire content (not just what in currently in the view, but the entire scrollable webpage) of a webbrowser control in an Access database form?
0
Ensure you’re charging the right price for your IT
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

I am creating a database with three tables. The names of my tables are One_tbl, States_tbl, and Two_tbl.

One_tbl has a primary field called Acode that is a primary key.
States_tbl has a field called "St" that is a primary key.

I want table Two_tbl to have all records from States_tbl filed "St" and all the records from Acode from my table One_tbl

What I want on table Two:

St           Acode

AK         15(a)
AK          15(c )
AL          15(a)
AL           15(c )


The above is an example of two States AK and AL. How do I do this? Attached is my sample databaseAdjustments.accdb
0
Hello experts:

I have a form that is bound to a table  This form is a datasheet that accepts an item number and quantity.  What I would like to do is if the item number has serial numbers, and after quantity update, I want to pop up another form (possibly another form that has a datasheet subform) that will have rows equal to the quantity entered into the original form.  So for example if the user enters item 123 and puts in  a quantity of 3, after update of the quantity, the popup form will display and it will have three rows where the user can enter (or select) the serial numbers.

Any help with this would be greatly appreciated.

Thanks!
0
On receiving data from a Json format from the RS 232 COM, I seem to have some a bit of a challenge, I have no problem in sending
(1)      I’m not sure at what point the received data (In Json string) from the gadget will  looped into  or iterated until passed through the table , I cannot see the actual connection here, my maths does not seem to balance. Kindly see if you can spot something here.
Below is the code requiring checking , currently there no errors whatsoever , but the connection on how that data which will be received will looped into the database that is where I’m behind.

Code requiring your attention

Private Sub CmdEmp_Click()
    Dim json As Object
    Dim i As Integer
    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Dim item As Object
    Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4
    Dim lngStatus As Long
    Dim strError  As String
    Dim strData   As String
    Dim lngSize As Integer
    ' Read maximum of 64 bytes from serial port.
    lngStatus = CommRead(intPortID, strData, 64)
    If lngStatus > 0 Then
        ' Process data.
    ElseIf lngStatus < 0 Then
        ' Handle error.
    End If

    ' Reset modem control lines.
    lngStatus = CommSetLine(intPortID, LINE_RTS, False)
    lngStatus = CommSetLine(intPortID, LINE_DTR, False)

    
    Set db = CurrentDb
    Set rs = db.OpenRecordset("Contact")
    
    i = 2
    For Each item In json
        
        With rs
            .AddNew
            ![id] = 

Open in new window

0
Hi
One person running an Access solution on a 13 inch screen is experiencing an overlap shown in the image. Is there a way to get around this?
Thanks
1
0
I am having issues diplaying graphs in a form.  I am able to pull it up on my laptop... but in many cases, when i pull up the same graph on a different computer, the graph loses its formatting.  The ms access is on a server.
0
Hello,

Is there a way to show a website url on a ms access form?
0
The variables lRow and lCol will only show the correct information on the first loop, the following loops is a report on the first loop. A similar thing happens if I use LastRow variable.


Public Function ExportToExcel(ReportFilterType)
' Tools > References > Microsoft Excel Object Library

On Error GoTo Error_Message
'Requires Reference to Microsoft Excel Object Library
 Dim rsMainList As DAO.Recordset
 Dim rsExport01 As DAO.Recordset
 Dim rsExport02 As DAO.Recordset
 Dim rsExport03 As DAO.Recordset
 Dim sqlExport01 As String, iCol01
 Dim sqlExport02 As String, iCol02
 Dim sqlExport03 As String, iCol03
 Dim xlObj As Object
 Dim xSheet01 As Object 'Upload File
 Dim xSheet02 As Object 'Batch Summary
 Dim xSheet03 As Object 'Batch Detail
 Dim strFolder As String
 Dim LastRow As Long
 
 On Error Resume Next
 DoCmd.Hourglass True
 Set rsMainList = CurrentDb.OpenRecordset("SELECT DISTINCT UPLOAD_ID, VISUAL_BATCH_ID, VISUAL_BATCH_TYPE, VISUAL_DATABASE  FROM VMTBL_NI_VM_ORCL_GL_UPLOAD_STAGING")
 If rsMainList.EOF Then Exit Function
 rsMainList.MoveFirst
 
 strFolder = CurrentProject.Path & "\"
 
 Do Until rsMainList.EOF
   
    Set xlObj = CreateObject("Excel.Application")
    xlObj.Workbooks.Add

    sqlExport01 = "SELECT Database, [Posting Date], [Account Combination], Co, Div, Fun, Rig, Job, AFE, Maj, Min, [I/C], [Debit Amount], " + _
    "[Credit Amount], [Total Amount],[GL Description], [Upload ID], [Batch ID], [Currency ID] " + _
    …
0
Hi All;

Im having the same error messages when sending data and receiving Json string using RS 232, before I start working on the gadget I want a second eye to  take a look on the code below, please  note the following :

9600 baud is converted to 64 bytes

All the  two codes for sending & receiving as well as for converting received data are called from the main code that has the data for sending since once the data is received by the gadget then the gadget is supposed to send a signature back instantly.

Receiving code


Private Sub CmdTaxReceive_Click()
Dim strData As String
Dim lngStatus As Long
Dim strError As String
Dim intPortID As Integer
' Read maximum of 64 bytes from serial port.
    lngStatus = CommRead(intPortID, strData, 64)

If lngStatus > 0 Then
        ' Process data.
 ElseIf lngStatus < 0 Then
      lngStatus = CommGetError(strError)
      MsgBox "COM Error: " & strError
      Stop
    End If
    
    lngStatus = CommFlush(intPortID)
    
    If lngStatus <> 0 Then
      lngStatus = CommGetError(strError)
      MsgBox "COM Error: " & strError
      Stop
    End If
' Reset modem control lines.
    lngStatus = CommSetLine(intPortID, LINE_RTS, False)
    lngStatus = CommSetLine(intPortID, LINE_DTR, False)
 ' Close communications.
    Call CommClose(intPortID)

End Sub

Open in new window

Sending code


Private Sub CmdSendTax_Click()
Dim intPortID As Integer ' Ex. 1, 2, 3, 4 for COM1 - COM4
    Dim lngStatus As Long
    Dim strError  As String
    Dim strData   As String
    Dim lngSize As Long

    ' Initialize Communications
    lngStatus = CommOpen(intPortID, "COM" & CStr(intPortID), _
        "baud=9600 parity=N data=8 stop=1")
    
    If lngStatus <> 0 Then
    ' Handle error.
        lngStatus = CommGetError(strError)
    MsgBox "COM Error: " & strError
    End If
 
    ' Set modem control lines.
    lngStatus = CommSetLine(intPortID, LINE_RTS, True)
    lngStatus = CommSetLine(intPortID, LINE_DTR, True)

    ' Write data to serial port.
    lngSize = Len(strData)
    lngStatus = CommWrite(intPortID, strData)
    If lngStatus <> lngSize Then
    ' Handle error.
    End If
End Sub

Open in new window



Calling them on the same form but on the main code


Call CmdTaxReceive_Click
Call CmdSendTax_Click
Call CmdEmp_Click

Open in new window



Where do I go wrong????



Auditing-tools.png


Blank-Invoices-Details.png
0
I am trying to run the code shown below in Access, but I get an “Object variable or With block not set” error. Please help me resolve the error.

Code:
Dim myApp As Object
myApp = CreateObject("InDesign.Application.CS6")

Dim myFileSystemObject As Object
myFileSystemObject = CreateObject("Scripting.FileSystemObject")

Dim myFile As String
myFile = myFileSystemObject.GetFile("C:\Temp\1.jsx")

I also tried, but I get the same error:
Dim myFile As Long

The following code runs without any errors in VB.Net:
Dim myApp As Object
        myApp = CreateObject("InDesign.Application.CS6")

       Dim myFileSystemObject = CreateObject("Scripting.FileSystemObject")

        Dim myFile = myFileSystemObject.GetFile("C:\Temp\1.jsx")
        myApp.DoScript(myFile, InDesign.idScriptLanguage.idJavascript)
        myApp = Nothing
0
Exploring ASP.NET Core: Fundamentals
LVL 13
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Hi
In creating an ACCDE file in Access is it possible to specify that it should be for a 32 bit or 64 bit machine? So I want to create one file for each
0
Hi. I am getting the following error trying to run an exe file. Is there an easy way to let Norton antivirus know that the file is safe to run

1
0
I have many tables that have fields set up as follows

Dataname
2015
2016
2017
2018
2019

I then run various queries, generally using the 2018 result field.
I've set up a combobox to change a TempVar for year.
But how do I use a variable to choose which field is chosen in a query. It seems you can only use variables in the criteria (i.e to determine which rows are used in the query rather than which columns are used)

Many thanks for any help in advance.
0
Hi
I am trying to import the following Excel spreadsheet to a staging table shown in the second image but getting message in the third image during the wizard in the import process. I have no idea what this means. Is it because the spreadsheet doesn't have all the columns?

1
2
3
0
I double clicked on my database that is split.  It asks me a password and i am successful with that.  It then loads and when I go to copy an object in it gives me a "The database has been placed in a state by user"Admin" on machine.....

I click on ok and close the database it then has another database open behind it even though I did not open it.  Password does not work on that one then it is closed.  What can I do?
0
I generate an Excel worksheet with a specific name. However, the user may regenerate the same excel several times which causes a problem at the time of saving the file (if another excel with the same name is open). Is there a way to close any other workbooks with the same name except the currently active workbook?

I currently use the following code or workaround:

On Error Resume Next 'ErrorSave
objExcel.ActiveWorkbook.SaveAs lFilename
lCtr = 1
Do While Err.Number = 1004 And lCtr < 10
  MsgBox "There is other Excel open with the same name: " & lFilename & " Pls CLOSE the old version first..."
  objExcel.ActiveWorkbook.SaveAs lFilename
  lCtr = lCtr + 1
Loop
objExcel.ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, FileName:=Trim(lFilename) & cPDFType
On Error GoTo 0

However, if the user closes all workbooks then the save is successful but it still returns Err.number = 1004? Not sure why... Thank you so much for any help. Rg Michael
0
I need to insert a collection called Tax Class within Json format/Ms access VBA code which is now almost complete see current results below:

Current results
{
   "PosSerialNumber": "102010",
   "IssueTime": "2019-09-15",
   "Customer": 1,
   "TransactionTyp": 0,
   "PaymentMode": 0,
   "SaleType": 0,
   "Items": [
      {
         "ItemID": 1,
         "Description": "Apple (Rgb 350 ML)",
         "BarCode": "6009803227328",
         "Quantity": 15,
         "UnitPrice": 41,
         "Discount": 0,
         "Taxable": [
            {
               "Total": 615,
               "IsTaxInclusive": "True",
               "RRP": 52.8
            }
         ]
      },

Open in new window


Expected results

{
   "PosSerialNumber": "102010",
   "IssueTime": "2019-09-15",
   "Customer": 1,
   "TransactionTyp": 0,
   "PaymentMode": 0,
   "SaleType": 0,
   "Items": [
      {
         "ItemID": 1,
         "Description": "Apple (Rgb 350 ML)",
         "BarCode": "6009803227328",
         "Quantity": 15,
         "UnitPrice": 41,
         "Discount": 0,
         "Taxable": [
              "B"
               ]
            {
               "Total": 615,
               "IsTaxInclusive": "True",
               "RRP": 52.8
            }
         ]
      },

Open in new window

Amendment required on VBA

How do I include the new collection ("tax category") in the below VBA to hold ["B"] just below "taxable"

Private Sub CmdSales_Click()
  
'  Const SQL_SELECT As String = 

Open in new window

0
Hi. In an Access project where the only way to see table objects is hold shift down while opening, can I use a different technique?
I am only asking because holding shift down doesn't always work
0
Hi

I am getting  the following message when trying to convert a linked table to a local one. Does this mean that tables that use the key values from this table will not enforce the use of the correct foreign key value after the conversion? Is there a way around this?
Thanks

1
0
OWASP: Forgery and Phishing
LVL 13
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Hi

I have a Temp Access table shown below. The integer values in the left column are foreign keys for another table.
On a form I want the user to be able to select from a drop down containing from the other table shown in the second image
and then populate the field with the foreign key and not the word. How do I build an Access form to do this? Thanks

Thanks

1

2
0
Hi. What Excel VBA code would I use to test if a value of 87 is present in a column named Col1 in a table named Table1 in an Access database in the same folder as the spreadsheet
0
Hi

What Excel VBA code would I use to insert records into an Access database in the same folder?

Thanks
0
Hi. In Access in trying to do an import using an Excel file  I am getting  a "Type Conversion Failure" error. The offending column has the formula =IFERROR(VLOOKUP(Entry!B2,Lookup!A:B,2,0),"")). This column is an integer foreign key
Are formulas not allowed for key value imports?
0
Hi Experts,

How can I figure out in a report with many controls, where is this attached message coming from?

Thanks
Untitled.png
0
I want to filter a datasheet based on the type of user logged in.

For Example

Private Sub Form_Load()
If Forms!Login!Role = "Southern Auditor" then
Me.Filter = "(CUSTOMER = 'University of Derby')or (CUSTOMER = 'Coventry University')or(CUSTOMER ='University of Leicester')"
else
Me.Filter = "(CUSTOMER <> 'University of Derby')or (CUSTOMER <> 'Coventry University')or(CUSTOMER <>'University of Leicester')"
end if

If the above doesn't make sense I want the Southern Auditor  to only see the 3 Customers else anybody else logged in see all other customers (excluding the 3 above).

Thank you
0

Microsoft Access

221K

Solutions

52K

Contributors

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.