Web Form error on sharepoint but not within access on PC

Kharahs

New member
Local time
Today, 07:11
Joined
Aug 22, 2012
Messages
3
I am building my first web database (synced with sharepoint server) with limited experience of Access (have done some small non-web databases mainly for personal or self-teaching purposes).
I have found the answers or at least clues to help solve many of the problems I've come across so far, but this one has me stumped and I cannot find any problems which are quite the same, possibly because all the similar problems are not *web* databases and therefore tend to use VB rather than macros.

I have a form which allows quick changes to multiple records in a table, which only contains fields which may need to be changed en mass.
I have a (macro) button on each row of the multiple item (continuous) form, which opens another form with further details of the relevant record.
This works beautifully on the PC I am using to design and sync this database with the sharepoint server, however, when I click this button on the webform accessed through a browser (I have tried a couple of different browsers just in case lol) it does not open the detail form, but gives me the following errors.

"The object doesn't contain the object 'ID' "
(ID is the field I have used to specify the record to open in the detail form)

Followed by
Action Failed
Macro Name: View Modify New Products : editbutton : OnClick : Embedded Macro
Condition:
Action Name: OpenForm
Arguments: Modify New Product Details, '=ID=' + Access.Actions.GetFormItemValue('Forms!View Modify New Products!ID',true) + '', Edit, Dialog
Error Number: 2766

This is the macro on the button:
OpenForm
Form name: Modify New Product Details
Where condition = [ID]=[Forms]![View Modify New Products]![ID]
Data mode: Edit
Window Mode: Dialog

Or if you're more comfortable viewing it as a line of code, it looks like this:
OpenForm (Modify New Product Details, [ID]=[Forms]![View Modify New Products]![ID], Edit, Dialog)

As previously mentioned, this works fine on my PC, which leads me to believe that I have the code correct, but after syncing with the server and accessing the webform on the network, it fails.


Any ideas?


Edit: Not sure if this is worth mentioning, but when i remove the [ID]=[Forms]![View Modify New Products]![ID] line from the "where" part of the macro, the form loads up fine, but of course goes to the first record instead of the specific record in line with the button- which is the desired result.
I would like to avoid the potential user errors and time wasting which is likely to ensue if I can't get this to work, so I appreciate any help anyone can offer!
 
Last edited:
I don't think the form reference will work when running in the browser window. The browser probably can't resolve what [Forms]![View Modify New Products]![ID] is or where to find it. Try setting a TempVar for the ID value and use that in the Where condition, like;

Code:
[B]SetTempVar[/B]
            Name: varID
      Expression:=[ID]

[B]OpenForm[/B]
       Form Name: Modify New Product Details
 Where Condition:=[ID]=[TempVars]![varID]
       Data Mode: Edit
     Window Mode: Dialog
 
Perfect! Thanks very much :)
I've had to use Tempvars for several tasks already, didn't even occur to me to use one here but your explanation is as useful as the code, so I'll know when I need them in future!
:D
 

Users who are viewing this thread

Back
Top Bottom