Share via

Error Messages with DoCmd.MoveSize and ColumnWidth code

Anonymous
2014-08-22T09:19:42+00:00

I am having problems with the following code:

DoCmd.OpenForm "frmShowAllocNos", acFormDS, "qryAllocNosNewSR24"

'Define the location of the top left hand corner of the table

DoCmd.MoveSize 8000, 100, ,

'PROBLEM Expected expression

It will accept DoCmd.MoveSize 8000, 100, "", "" but it gives the error 'The expression you entered is the wrong data type for one of the arguments'

I also tried:

Forms!frmShowAllocNos.MoveSize 5000, 100, ,

'PROBLEM Application-defined or object-defined error

The code then includes

Forms!frmShowAllocNos!Title.ColumnWidth = -2

'This line appears to be OK but

Forms!frmShowAllocNos!NounPrefix.ColumnWidth = -2

'PROBLEM Object does not support this property or method

Forms!frmShowAllocNos!NounSuffix.ColumnWidth = -2

'PROBLEM Object does not support this property or method

Forms!frmShowAllocNos!AreaNumber.ColumnWidth = -2

'PROBLEM Object does not support this property or method

Perhaps I could use AutoResize to set the column widths to suit the longest data in each field  

Regards

Barry GC

I have been interrupted during the preparation of this post but I feel that the problem is correctly reflected above.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2014-08-22T14:37:24+00:00

Try

DoCmd.MoveSize 8000, 100

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful