• WSjasonsas

    WSjasonsas

    @wsjasonsas

    Viewing 15 replies - 1 through 15 (of 37 total)
    Author
    Replies
    • in reply to: Opening Word template appears as ‘Read-Only’ #1434954

      Hi mlwonio and Andrew,

      Here is the code I’m using to open the template:

      Set wdapp = CreateObject(“Word.Application”) ‘Create an instance of Word
      wdapp.Documents.Add Template:=TemplatePath & TemplateName ‘Open the template the user has chosen
      Set ActiveTemplate = wdapp.ActiveDocument ‘Set the ‘ActiveTemplate’ variable

      At the end of the sub I use this line:

      ActiveTemplate.AttachedTemplate = “”

      The document I’m opening is definitely saved as a Word Template. If I check the value of ‘AttachedTemplate’ before I get to that line, it’s set to the value of the template they’ve opened. If I check it just after that line execute, I get “Normal.dot”.

      Admittedly I’ve been testing this locally on my PC, but these are the results I’m getting:
      – If I try to open the template just before I execute ‘ActiveTemplate.AttachedTemplate = “”‘, the template is marked as ‘Read-Only’
      – If I try to open the template just after I execute ‘ActiveTemplate.AttachedTemplate = “”‘, the template is marked as ‘Read-Only’
      – If I try to open the template after I close the document I’ve generated, the template is NOT marked as ‘Read-Only’

      Does it matter that I’m testing this locally on my PC? Ie, I’m still trying to open the template on the same PC I’ve generated the document, even though I’ve set the ‘AttachedTemplate’ to “”.

    • in reply to: Opening Word template appears as ‘Read-Only’ #1433499

      I’ve tested setting the attachtemplate to “” this morning but the underlying template still appears as read only until I close the document that I created. Any suggestions?

    • in reply to: Opening Word template appears as ‘Read-Only’ #1433439

      Thanks Andrew for replying.

      When you say that ‘if you set it to nothing, you are actually attaching the ‘Normla template”, what does that actually mean for the document itself? Will it not appear correctly?

    • in reply to: Strange pop-up box on template #1251993

      HI Gary, that’s exactly what it was. Thanks for your help, problem is now resolved.

    • in reply to: Form design question #1250837

      Hi John,

      I’ve changed the design slightly because each case is now able to have multiple offences. Please see the new attachment for the updated design. It still works basically the same way in that I would still create records in tblCaseOffencePeriodLine using a Listbox drawing values from tblOffencePeriod. I haven’t added more fields to the tblCaseOffencePeriodLine but would need to add two more fields to hold offence date and due date.

      Cheers,

    • in reply to: Updating fields in a junction table #1249919

      Ok, I’ve gotten a little further with this. I’ve added a sub-form based on the tblCaseOffencePeriodLine table. This allows users to choose the offence period and it automatically fills in the related case ID, which is what I want. However I want to restrict the periods they can select from based on the type of offence they chose on the form. Eg, Offence 1 might relate to periods 1999, 2000, 2001. Offence 2 might relate to periods ‘Quarter ending March 2010’, ‘Quarter ending June 2010’. So as they fill in the offence type on the form, I want to restrict the values they see on the sub-form. Does that make sense? Is this possible?

      Cheers,
      Jason

    • in reply to: Updating fields in a junction table #1249911

      Hi John,

      I thought it might be a bit hard to explain in an email. I’ve attached a relationship diagram. I’m quite new to access, so maybe my relationships aren’t set up correctly? Hope this helps.

      Cheers,
      Jason

    • in reply to: Field showing blank on form reopen #1249694

      Thankyou so much John, that works perfectly. Much appreciated!

    • in reply to: Event procedure for control on dynamic form #1249065

      Thanks for all the help guys, much appreciated!

    • in reply to: Event procedure for control on dynamic form #1248924

      Yes you can move controls via code without switching to Design view.

      Hi John,

      Are you able to point me in the right direction for this as far as code goes? I’m actually thinking of using this for another question I just posted about whether to use 2 tables for ‘individuals’ and ‘corporations’. For example, if a user wishes to create a new ‘client’, I currently have a drop down box which lets them select ‘individual’ or ‘client’. Depending on what they choose, I want to unhide and hide and also move controls around dynamically.

      cheers,
      Jason

    • in reply to: Event procedure for control on dynamic form #1248920

      Another way is to move the controls around on the form by setting the Left and Top Properties as needed.

      Hi Bob,

      Am I able to do this ‘dynamically’? By that I mean, without putting the form into design view, moving the fields around and then redisplaying the form?

      Cheers,
      Jason

    • in reply to: Event procedure for control on dynamic form #1248896

      Hi bob,

      I thought about this, but one of the reasons I thought about not doing this was that depending on where teh controls were created on the form in the first place, they would appear in different spots as others were hidden or unhidden. (Eg, one control might appear at the top of the form while another might in the bottom right.

      Is there a way around this?

      Cheers,
      Jason

    • in reply to: Displaying different variables/fields to a user #1247769

      Hi Kent,

      Thanks for that tip. I’m assuming I would have a query that runs that when the user selects a template, it would search a table to find which variables relate to a particular template.

      On the sub-form, would I need to build the form which shows all the variables and then use the query to show only the variables I want? Or am I able to (and is it better) to build the form ‘dynamically’ (Eg, only build the form once the user selects which template they want to use?)

      Cheers,
      Jason

    • in reply to: Displaying different variables/fields to a user #1247349

      Hi kentg,

      when I say modify, I mean that I want them to enter a value for these variables. Eg, different start/end dates, different case numbers etc.

      Would I need to have a different form for each template? The number of templates could be over 100 – is there an easier way to do this?

      Cheers,
      Jason

    • in reply to: Form filters and refreshing forms #1246854

      Hi John,

      Yes, I want it so that the user cannot view clients from other states. I’ve actually got the form already based on a query, but how do I modify it so that the query looks up the ‘ChosenState’ from what the user selected?

      Cheers,

    Viewing 15 replies - 1 through 15 (of 37 total)