Forum Discussion
VBA issue
cmancas Probably something in your form design is causing this...open your form in design view and check if you have any "unusual" controls...also this is a database created from scratch or something you copy-paste and tweaked it...maybe some leftovers are causing the issue.
- cmancasJul 27, 2020Copper Contributor
it's a db created from scratch by my, with the Access form wizard, in datasheet form, over the following table, without making then any other modification than adding it that Form_BeforeUpdate method:
CREATE TABLE OPTIONS (
x COUNTER PRIMARY KEY,
FlightNo VARCHAR(8) NOT NULL UNIQUE,
Airline LONG NOT NULL,
CONSTRAINT fkAirline FOREIGN KEY (Airline) REFERENCES AIRLINES,
Embarkment LONG NOT NULL,
CONSTRAINT fkEmbarkment FOREIGN KEY (Embarkment) REFERENCES AIRPORTS,
Destination LONG NOT NULL,
CONSTRAINT fKDestination FOREIGN KEY (Destination) REFERENCES AIRPORTS,
TakeOffLocDateTime DATETIME NOT NULL,
LandingLocDateTime DATETIME NOT NULL,
FlightTime VARCHAR(5),
CONSTRAINT Koptions UNIQUE (Airline, Embarkment, Destination, TakeOffLocDateTime, LandingLocDateTime) )Moreover, on the smallest table in this db (
CREATE TABLE AIRLINES (
x COUNTER PRIMARY KEY,
Airline VARCHAR(8) NOT NULL UNIQUE )) I've created a similar form, attached to its class this super simple VBA method:
Private Sub Form_Open(Cancel As Integer)
MsgBox "Hello world!"
End Suband the result is the same: I got same error on impossible communication with the OLE server or an ActiveX control.
I'm quite sure that this not a programming issue, but a Romanian version of Access 2016.
I immensely regret that, here, we are offered only this Romanian version instead of the US one...
Best regards and thanks once more,
Christian Mancas
- cmancasJul 27, 2020Copper Contributorp.s. please excuse my typo errors - this is an example for my next book scheduled to be published this fall in the US and I'm in a hurry: of course that the db was created by me, not by my 🙂
- cmancasJul 27, 2020Copper Contributorp.p.s. there is also a missing right parenthesis in the definition of the kOptions key 🙂