SharePoint linked Access Database form

dilipramadas

New Member
Joined
Feb 8, 2010
Messages
7
Hi Guys,

I'm working on a piece of automation which is based on Access DB form which is linked to SharePoint.

I've created a form with multiple combo boxes and couple of text boxes. After googling a LOT, I was able to automate the event procedure for one of the combo box. But when i tried replicating the same for another combo box, it doesn't work. I've changed the declarations and I've also looked into the tables the
I'm new to Access and tried writing the macro based on the excel VBA I written in past.
Here is what I'm trying to achieve: When the form user selects one option from the 1st combo box, in the 2nd combo box it show a list which corresponds to the selection in 1st combo box.

Below is the code.
Code:
Option Compare Database


Public Function GetDivisionPrivate Sub cboFunction_Change()
Call GetDeptList(cboFunction.SelText)
End Sub
 
Public Function GetDeptList(sFunctionName As String) As Boolean
Dim db As DAO.Database
Dim Trs As DAO.Recordset
Dim FtrSQL As String
 
On Error GoTo GetTaskName_Error
 
GetTaskName = False
 
Set db = CurrentDb
 
FtrSQL = "SELECT tb_tasks.[Tasks] ,tb_tasks.[ID] " & _
         "FROM tb_function INNER JOIN tb_tasks ON tb_function.ID = tb_tasks.Task_ID " & _
         "Where tb_tasks.[Tasks]='" & sFunctionName & "'"
                 
    Set Trs = db.OpenRecordset(FtrSQL, dbOpenSnapshot)
Trs.MoveFirst
 
Me!cboTask = Null
 
If Not Trs.EOF Then
    Me!cboTask.RowSource = FtrSQL
End If
 
Trs.Close
db.Close
 
GetTaskName = True
 
GetTaskName_Error:
    'MsgBox Err.Description
 
 
End

Any help on this is appreciated! :(

Best regards,
Dilip
 
Make sure your spelling is right - it's very common people just don't have the right names for controls on forms. I don't know what you mean by move to next line in DB - what's supposed to move? Move to what, in where?

The spellings are correct. Sorry for not being clear.
In the access form which has several combo boxes and an attachment field. Everything is working fine till i close the form and reopen it to use for the second time. When I open the form again the attachment field shows the previously attached files. I tried using Me.Attachment87 = "" (I've also used nothing and null) to clear the attachment field from the form. However, it doesn't work. It shows an error stating "The list item could not be inserted or updated because duplicate values were found for one or more fields in the list."
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Well, that's probably a multi-valued field then, since it can have multiple attachments. Plus I still don't know if it holds string data (filepaths) or binary data (actual attachments).
 
Upvote 0

Forum statistics

Threads
1,221,813
Messages
6,162,117
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top