Good evening, I'm a bit of a novice with access but I'm trying to work on automating some mundane tasks at work.
I want to make a form in access that I can press a button it will switch to my work program, navigate to the correct part (I have this working with AppActivate and SendKeys) but I need to open up files within the program and am not sure how to navigate to the correct file and open it with my limited knowledge. I can get to an open dialog box, and can even get that working fine but I don't want to use the default folder it opens to - how would I make it open something located in say C:\Windows\Test\openthis.ab?
I've attached my button code so you can see what I'm thinking here. I'm sure there are probably better ways to go about this but I'm not very experienced
I want to make a form in access that I can press a button it will switch to my work program, navigate to the correct part (I have this working with AppActivate and SendKeys) but I need to open up files within the program and am not sure how to navigate to the correct file and open it with my limited knowledge. I can get to an open dialog box, and can even get that working fine but I don't want to use the default folder it opens to - how would I make it open something located in say C:\Windows\Test\openthis.ab?
I've attached my button code so you can see what I'm thinking here. I'm sure there are probably better ways to go about this but I'm not very experienced
Code:
Private Sub Command0_Click()
AppActivate ("AppNameHere")
SendKeys "%N"
SendKeys "R"
SendKeys "%D"
SendKeys "E"
Dim T1 As Variant
Dim T2 As Variant
T1 = Now()
T2 = DateAdd("s", 2, T1)
Do Until T2 <= T1
T1 = Now()
Loop
SendKeys "%F"
SendKeys "O" 'A windows "Open" dialog box opens here
T1 = Now()
T2 = DateAdd("s", 1, T1)
Do Until T2 <= T1
T1 = Now()
Loop
'here I can do SendKeys again to make it type something and open something in that folder but I want to open something elsewhere.
End Sub